maven項目生成war包


eclipse:
配置 你的pom.xml文件,在你的overview視窗里 配置 packaging為 war 然后添加

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<warName>ROOT</warName>
<archiveClasses>true</archiveClasses>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>src\main\resources</directory>
<targetPath>WEB-INF\classes</targetPath>
<!-- the list has a default value of ** -->
<includes>
<include>**</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>

然后點擊 pom.xml右鍵,run  as 選擇 install 或是 package
如果項目沒問題,配置沒問題
就會在項目的
========================================更新=====================================================
idea命令行操作:
mvn clean
mvn package
忽略test打包: mvn package -Dmaven.test.skip=true


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM