【发布时间】:2017-02-25 12:26:57
【问题描述】:
我目前正试图从我建造的战争中排除一些资源。 我已经阅读了文档和论坛,并找到了很多信息。
不幸的是,在我的情况下没有任何效果......
我有一个 Eclipse Maven 项目,如果我是对的,maven-war-plugin 是默认的“战争构建器”,所以我必须在我的 pom.xml 中覆盖它,以便从 buildt 战争中排除资源。
我试过warSourceExcludes、packagingExcludes和webResources/excludes:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warSourceExcludes>src/main/webapp/frontEndWorkspace</warSourceExcludes>
<packagingExcludes>src/main/webapp/frontEndWorkspace
</packagingExcludes>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>src/main/webapp</directory>
<!-- the list has a default value of ** -->
<excludes>
<exclude>**/frontEndWorkspace</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
尽管有这样的配置,我的 Tomcat 中仍然有 frontEndWorkspace 目录推送...
不知道是不是因为我在 Eclipse 环境中使用了它?
提前致谢!
【问题讨论】:
-
您是否尝试过在没有任何 IDE 的情况下在纯命令行上运行...
-
否 我确实使用了我的 IDE。为什么?在eclipse中使用maven有问题吗?默认构建的行为不一样?
标签: eclipse maven maven-war-plugin