Maven WAR插件会跳过资源吗? [英] maven WAR plugin skips resources?

查看:65
本文介绍了Maven WAR插件会跳过资源吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在这简直是不可思议:我有许多文件夹/文件要复制到WAR中,这是POM的相关部分:

Now this is downright bizarre: I have a number of folders/files I want copied into my WAR, here's the relevant part of the POM:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <webResources>
        <resource><directory>../common-web-content/src/main/resources</directory></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>

所有路径均正确且经过仔细检查.但是,第二个 资源文件夹不会被复制-在这种情况下为pqm-web-content,但是即使我更改了顺序,也总是缺少第二个.但是没有错误消息:

The paths are all correct and double-checked. However, the second resource folder is not copied - in this case pqm-web-content, but even if I change the sequence, it's always the second one that's missing. But there is no error message:

[INFO] Processing war project
[INFO] Copy webapp webResources[D:\pqmGF\pqm\pqm-war\../common-web-content/src/main/resources] to[D:\pqmGF\pqm\pqm-war\target\pqm-war-3.3.5.0-SNAPSHOT]
[INFO] Copy webapp webResources[D:\pqmGF\pqm\pqm-war\../pqm-web-content/src/main/resources] to[D:\pqmGF\pqm\pqm-war\target\pqm-war-3.3.5.0-SNAPSHOT]
[INFO] Copy webapp webResources[D:\pqmGF\pqm\pqm-war\../common-presentation/src/main/webapp] to[D:\pqmGF\pqm\pqm-war\target\pqm-war-3.3.5.0-SNAPSHOT]
[INFO] Copy webapp webResources[D:\pqmGF\pqm\pqm-war/src/main/webapp/WEB-INF] to [D:\pqmGF\pqm\pqm-war\target\pqm-war-3.3.5.0-SNAPSHOT]
[INFO] Webapp assembled in[7891 msecs]

推荐答案

显然,这是Maven的错误或Maven 3.0.3与WAR插件之间的不兼容性.切换到Maven 2.2.1后,它可以正常工作.

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.

这篇关于Maven WAR插件会跳过资源吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆