Using Maven shade plugin in a multi module project

Posted by Manoj on Stack Overflow See other posts from Stack Overflow or by Manoj
Published on 2010-06-30T08:17:39Z Indexed on 2011/01/04 19:53 UTC
Read the original article Hit count: 247

Filed under:
|

I have a scenario where-in I need to create an uber jar of a multi module maven project including all modules and their dependencies. I tried using maven shade plugin. but it seems to work only when I use it at the module level. If I add the plugin entry in parent pom then the build breaks (it tries to shade the parent pom)

 [INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing null with C:\Projects\foo.bar\target\foobar-0.0.1-SNAPSHOT-shaded.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating shaded jar: null

It does seem to make sense since the <packaging> for the parent maven project is pom. But there should be some way to create an uber jar for a multi module project... Any ideas people???

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about uberjar