Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    The maven-shade-plugin also works similarly and is dedicated to this purpose. Commented Jan 7, 2010 at 20:46
  • 4
    This does not work for spring, and other libraries that expect multiple resources with the same name on the class path. In the case of spring, META-INF\spring.schemas is included in several jars (beans, jdbc, etc) and is used to configure XML namespace support for the XML parser. If you try 'jar-with-dependencies', pasing application-context.xml will fail at runtime with something like "org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'." Commented Mar 4, 2010 at 10:37
  • @David Maven won't solve a Java "limitation". Just package your application cleanly (i.e. not in a uberjar) in that case. Commented Mar 4, 2010 at 15:55
  • This works with Spring configuration with no issues. My main class loads all other classes with Classpath Application context and this solution works perfectly. Commented Dec 20, 2010 at 18:25
  • 2
    The assembly:assembly goal is deprecated Commented Nov 4, 2013 at 0:11