Exclude resources from dependency jar

I have a maven projects let's call it A which has dependency on two maven projects B, C. Both B and C has a file in resources with same name let say x.xml. I want to exclude this x.xml from B(I don't want to write exclude it from B's jar in M2) jar when building A's War. means it should be present in B's jar but when this jar is copied to A's war should not available. Is it possible?


例如,使用truezip-maven-plugin从依赖关系jar中删除文件

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.1</version>
<executions>
    <execution>
        <id>remove-a-file-in-sub-archive</id>
        <goals>
            <goal>remove</goal>
        </goals>
        <phase>package</phase>
        <configuration>
            <fileset>
                <directory>target/mywar-webapp.war/WEB-INF/lib/dependency.jar/dirName/</directory>
                <includes>
                    <include>fileName.xml</include>
                </includes>
            </fileset>
        </configuration>
    </execution>
</executions>

链接地址: http://www.djcxy.com/p/90580.html

上一篇: 在Apache Spark中使用R

下一篇: 从依赖关系jar中排除资源