Maven常用命令

gary-liu發表於2017-05-05

maven 打包

pom.xml 中在</dependencies> 標籤下加

<build>
        <finalName>monitor</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <webResources>
                    <resource>
                    <directory>src/main/webapp</directory>
                    <filtering>true</filtering>
                    <targetPath>WEB-INF</targetPath>
                    </resource>
                    </webResources>
                    <warName>monitor</warName>
                </configuration>
            </plugin>
        </plugins>
    </build>

打包並忽略測試檔案

mvn  clean package -DskipTests

相關文章