Reputation: 9
My project uses a jar that contains a file named broker.xml. Also I have a second file with the same name broker.xml in the resource folder. When I run the web application, I get an error "duplicates non mergeable resource broker.xml".
Is there a way to exclude the xml file inside the jar?
Upvotes: 1
Views: 1241
Reputation: 1838
Try TrueZIP
Maven Plugin, looks like it suits your scenario
<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/Samplewebapp.war/WEB-INF/lib/someJar.jar</directory>
<includes>
<include>broker.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
refer to below link for documentation
http://www.mojohaus.org/truezip/truezip-maven-plugin/
http://www.mojohaus.org/truezip/truezip-maven-plugin/remove-mojo.html
Also refer to below stackoverflow link (look at answer from @Andrea) Remove file from dependency jar using maven
Upvotes: 1