【发布时间】:2020-01-23 21:07:20
【问题描述】:
我有一个项目,我试图用来自另一个模块的已编译 jar 和 war 项目中的一些文件覆盖预构建的战争。
+pom.xml
|
+-+depandancy_dir
| |
| + source.war
|
+-+ jar
| |
| + pom.xml
| + src
| ...
|
+-+war_dir
|
+ pom.xml
+ src
.... no jars
我想排除一些配置为 jar 的 maven 依赖项的 jar。
我已经在 pom 中为战争尝试了以下所有排除行。无论如何都会出现不需要的罐子。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<dependentWarExcludes>**/unwanted-core-1.1.jar</dependentWarExcludes>
<overlays>
<overlay>
<groupId>src.war</groupId>
<artifactId>base.war</artifactId>
<excludes>
<exclude>**/unwanted-core-1.1.jar</exclude>
<packagingExcludes>**/unwanted-core-1.1.jar</packagingExcludes>
<exclude>WEB-INF/lib/unwanted-core-1.1.jar</exclude>
<packagingExcludes>WEB-INF/lib/unwanted-core-1.1.jar</packagingExcludes>
</excludes>
</overlay>
</overlays>
</configuration>
</plugin>
我在eclipse下运行maven。 war插件报告版本maven-war-plugin:2.2:war
【问题讨论】: