1. 程式人生 > >maven自動化構建deploy

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>