项目基目录之外的目录。 Maven-war-plugin - <webresources>

时间:2018-05-09 11:09:00

标签: java eclipse maven warnings maven-plugin

由于我的pom.xml war-plugin配置,我在Eclipse中有Maven Problems警告。

该项目有多个模块。层次结构在这里: Project hierarchy

我需要将特定目录(module2中的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包中?

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

与覆盖版本警告不同,该警告可以在版本之后添加注释“ $ NO-MVN-MAN-VER $”,到目前为止,似乎还没有解决该问题的好方法。

唯一可以做的事情(我也是以我为例)完全禁用“ Maven Build Participant Problems”:

  • 问题视图->右上角的向下箭头按钮
  • “配置内容”
  • 在活动配置中,在“ Maven问题”中停用“ Maven Build参与者问题”复选框。

enter image description here

相关问题