由于我的 pom.xml war-plugin 配置,我在 Eclipse 中收到 Maven 问题警告。
该项目有多个模块。层次结构在这里: Project hierarchy
我需要将特定目录(模块2中的webapp)的内容打包到模块中。 top pom.xml配置的主要部分在这里:
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<webResources>
<resource>
<directory>../module2/src/main/webapp</directory>
</resource>
</webResources>
<packagingExcludes>**/*.db,**/*.scss,**/*.example,**/abrepository/**,,**/abconnection.xml</packagingExcludes>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
</plugins>
模块配置的主要部分在这里:
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>modul</warName>
</configuration>
</plugin>
</plugins>
有了这个 war-plugin 配置,我有一个我想排除的警告:
***module\..\module2\src\main\webapp" directory outside of project base directory. (org.apache.maven.plugins:maven-war-plugin:3.2.0:war:default-war:package) pom.xml /module line 1 Maven Build Participant Problem
我可以去掉它吗,或者我可以用不同的方式将文件夹 (webapp) 的内容添加到 .war 包中吗?
感谢您的帮助。
最佳答案
与覆盖版本警告不同的是,在版本后面可以加注解“$NO-MVN-MAN-VER$”,这个问题目前好像还没有优雅的解决办法。
你唯一能做的(我在我的例子中做了)就是一起禁用“Maven Build Participant Problems”:
- 问题 View -> 右上角的向下箭头按钮
- “配置内容”
- 在您的 Activity 配置中,在“Maven Problems”中停用“Maven Build Participant Problems”复选框
关于java - 项目基目录之外的目录。 Maven-war-plugin - <webResources>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50251923/