maven WAR plugin skips resources?

空扰寡人 提交于 2019-12-03 12:51:00

Apparently, this is a bug of Maven or incompatibility between Maven 3.0.3 and the WAR Plugin. After switching to Maven 2.2.1, it works correctly.

have you considered doing something like this...

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <webResources>
        <resource><directory>../common-web-content/src/main/resources</directory></resource>
        <!-- this next line is repeated because of a problem I am having with the maven-war-plugin -->
        <resource><directory>../pqm-web-content/src/main/resources</directory><filtering>true</filtering></resource>
        <resource><directory>../pqm-web-content/src/main/resources</directory><filtering>true</filtering></resource>
        <resource><directory>../common-presentation/src/main/webapp</directory></resource>
        <resource>
          <directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
          <includes><include>web.xml</include></includes>
          <filtering>true</filtering>
          <targetPath>WEB-INF</targetPath>
        </resource>
      </webResources>
    </configuration>
</plugin>

I had similar problem with maven-war-plugin version 2.6 when from two consecutive directories, first's contents would not be copied to final build. Problem was that I had two <directory> tags in single <resource> tag. Single <resource> with single <directory> tag worked fine.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!