项目基目录之外的目录。 Maven-war-插件-<webResources>

Directory outside of project base directory. Maven-war-plugin - <webResources>

我在 Eclipse 中遇到 Maven 问题 war,因为我的 pom.xml war-插件配置。

该项目有多个模块。层次结构在这里: 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-插件配置,我有这个 warning 我想排除:

***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":

  • 问题视图 -> 右上角的向下箭头按钮
  • "Configure Contents"
  • 在您的活动配置中,取消激活 "Maven Problems" 复选框 "Maven Build Participant Problems"