使用maven打包项目时,maven-war-plugin:war目标有以下信息。
[INFO] Packaging webapp
[INFO] Assembling webapp [xxx] in [/Users/zhangna13/Workspace/xxx/xxx/target/xxx-release-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/zhangna13/Workspace/xxx/xxx/src/main/webapp]
[INFO] Webapp assembled in [2230 msecs]
[INFO] Building war: /Users/zhangna13/Workspace/xxx/xxx/target/xxx-release-1.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
我在目标目录中找到web.xml,但为什么存在2个web.xml文件?
答案 0 :(得分:0)
要消除警告,您必须将非直观配置参数<packagingExcludes>
添加到maven-war-plugin
的配置中。我把它放在<pluginManagement>
下:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>