我可以让Maven配置文件将webResources添加到war中,而仍然添加未配置的webResources吗?

我可以让Maven配置文件将webResources添加到war中,而仍然添加未配置的webResources吗?,maven,maven-war-plugin,Maven,Maven War Plugin,例如: 我希望并期望以下pom在“profile”概要文件处于活动状态时同时部署profileResources和commonResources,但它只部署profileResources。我能做些什么来达到预期的效果 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven

例如:

我希望并期望以下pom在“profile”概要文件处于活动状态时同时部署profileResources和commonResources,但它只部署profileResources。我能做些什么来达到预期的效果

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>test</artifactId>
  <packaging>war</packaging>
  <version>0.0.0</version>
  <profiles>
    <profile>
      <id>profile</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
              <webResources>
                <resource>
                  <directory>src/main/profileResources</directory>
                </resource>
              </webResources>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <webResources>
            <resource>
              <directory>src/main/commonResources</directory>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

4.0.0
com.example
测试
战争
0.0.0
轮廓
maven战争插件
2.1.1
src/main/profileResources
maven战争插件
2.1.1
src/main/commonResources
工作版本(供将来参考)


4.0.0
com.example
测试
战争
0.0.0
轮廓
maven战争插件
2.1.1
src/main/profileResources
maven战争插件
2.1.1
src/main/commonResources
Git Word在损坏版本和工作版本之间的差异

diff --git a/tmp/broken-pom.xml b/tmp/working-pom.xml
index 2fd9bbf..b04683f 100644
--- a/tmp/broken-pom.xml
+++ b/tmp/working-pom.xml
@@ -31,5 +31,5 @@
        <version>2.1.1</version>
        <configuration>
          <webResources{+ combine.children="append"+}>
            <resource>
              <directory>src/main/commonResources</directory>
diff--git a/tmp/break-pom.xml b/tmp/working-pom.xml
索引2fd9bbf..b04683f 100644
---a/tmp/break-pom.xml
+++b/tmp/working-pom.xml
@@ -31,5 +31,5 @@
2.1.1
src/main/commonResources

尝试将
combine.children=“append”
添加到非配置文件插件中的
资源
元素中-我认为这是混乱的,因为默认行为意味着配置文件设置将覆盖树上具有相同名称的任何内容。有关合并/附加属性的详细信息,请参见

diff --git a/tmp/broken-pom.xml b/tmp/working-pom.xml
index 2fd9bbf..b04683f 100644
--- a/tmp/broken-pom.xml
+++ b/tmp/working-pom.xml
@@ -31,5 +31,5 @@
        <version>2.1.1</version>
        <configuration>
          <webResources{+ combine.children="append"+}>
            <resource>
              <directory>src/main/commonResources</directory>