The World’s Largest Online Community for Developers

'; java - How to exclude an xml file in a maven jar dependency - LavOzs.Com

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?

Try TrueZIP Maven Plugin, looks like it suits your scenario


refer to below link for documentation

Also refer to below stackoverflow link (look at answer from @Andrea) Remove file from dependency jar using maven

How do I tell Maven to use the latest version of a dependency?
Can I add jars to maven 2 build classpath without installing them?
How can I create an executable JAR with dependencies using Maven?
'Must Override a Superclass Method' Errors after importing a project into Eclipse
How to add local jar files to a Maven project?
IntelliJ inspection gives “Cannot resolve symbol” but still compiles code
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
Can't execute jar- file: “no main manifest attribute”
Dealing with “Xerces hell” in Java/Maven?
How to add local .jar file dependency to build.gradle file?