maven自动化构建deploy

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.atguigu.maven</groupId>
    <artifactId>WebProject</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1.3-b06</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
    <!-- 配置当前工程构建过程中的特殊设置 -->
    <build>
        <finalName>AtguiguWeb</finalName>
        
        <!-- 配置构建过程中需要使用的插件 -->
        <plugins>
            <plugin>
                <!-- cargo是一家专门从“启动Servlet容器”的组织 -->
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.2.3</version>
                
                <!-- 针对插件进行的配置 -->
                <configuration>
                    <!-- 配置当前系统中容器的位置 -->
                    <container>
                        <containerId>tomcat6x</containerId>
                        <home>D:\DevInstall\apache-tomcat-6.0.39</home>
                    </container>
                    <configuration>
                        <type>existing</type>
                        <home>D:\DevInstall\apache-tomcat-6.0.39</home>
                        <!-- 如果Tomcat端口为默认值8080则不必设置该属性 -->
                        <!-- <properties>
                            <cargo.servlet.port>8989</cargo.servlet.port>
                        </properties> -->
                    </configuration>
                </configuration>
                
                <!-- 配置插件在什么情况下执行 -->
                <executions>
                    <execution>
                        <id>cargo-run</id>
                        
                        <!-- 生命周期的阶段 -->
                        <phase>install</phase>
                        <goals>
                            <!-- 插件的目标 -->
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

猜你喜欢

转载自www.cnblogs.com/znsongshu/p/10082946.html
今日推荐