2

私が集めたようにmaven-war-plugin、オーバーレイのターゲットにすでに存在するファイルを上書きしないでください。たとえば、 Bに依存するwar Aがあり、両方ににあるリソースが含まれている場合、結果にはAプロジェクトからのが含まれます。war src/main/resources/some.xmlA.warsome.xml

元のリソース( A )よりも依存関係( Bmaven-war-pluginのリソースを優先するようにに指示するにはどうすればよいですか?

4

2 に答える 2

1

http://maven.apache.org/plugins/maven-war-plugin/overlays.htmlを参照してください:

"たとえば、オーバーレイmy-webappの index.jsp ファイルを webapp に設定する 必要があるが、他のファイルは通常の方法で制御できる場合、my-webappに 2 つのオーバーレイ構成を定義"

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
      <overlays>
        <overlay>
          <id>my-webapp-index.jsp</id>
          <groupId>com.example.projects</groupId>
          <artifactId>my-webapp</artifactId>
          <includes>
            <include>index.jsp</include>
          </includes>
        </overlay>
        <overlay>
          <!-- empty groupId/artifactId represents the current build -->
        </overlay>
         ...
      </overlays>
    </configuration>

これは最終的な決定ではなく、開始点であると思います。

于 2013-01-19T09:13:40.043 に答える
0

maven-resources プラグインを使用して、ファイルを目的の場所にコピーできます。戦争の前か後か。

于 2011-10-19T20:26:19.153 に答える