Exclude resources from the dependency ban

I have maven projects, let me call it A, which has a dependency on two projects maven B, C. Both B and C have a file in resources with the same name, let them say x.xml. I want to exclude this x.xml from B (I do not want to write to exclude it from B jar in M2) jar when creating A War. means that he must be present in Bank B, but when this bank is copied into War, it should not be available. Is it possible?

+7
maven maven-2 maven-3
source share
1 answer

Delete file from dependency ban using truezip-maven-plugin, e.g.

<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> 

+4
source share

All Articles