The answer given below makes me wonder once more what's the best practices,
i.e. which plugin the maven team recommends for each use case.
Here's two assertions about shade and assembly, I'd be delighted that some
of the maven team members correct or confirm those. I feel it could clarify
things for maven users:
- When maven-shade-plugin went out, I thought it was designed to be a
first-choice replacement for the maven-assembly-plugin/jar-with-dependencies
- Maven-assembly-plugin can do a lot more than just packaging an
uber-jar, that's why he remains useful. But when just wanting to package an
uber-jar, the recommended/maven way is using maven-shade-plugin.
Thanks in advance.
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
interesting points, I'd like to know more them too :P
Have a nice weekend,
I should warn everyone here, that I should not be referenced when
discussing "best practices".
I would best describe our experience as "just practicing".
I can only say that something worked for us after either a bunch of
testing or a lucky break after a bit of Google searching.
That's not my take. Speaking for myself, shade is good when you want
to not only create a jar-with-dependencies but you also want to
"shade" some or all of the 3rd party classes/artifacts (move them
under your own class heirarchy eg com.sun => net.wfay.com.sun).
Assembly is good when you simply want jar-with-deps bundles or need to
construct other random packages types with specific layouts for
installation or deployment into particular environments.
If you don't need/want to shade any of the artifacts, there is no need
to use m-shade-p, and you should be using m-assembly-p (IMO).
I'm not a Maven Developer so feel free to ignore this if/when one of
them comes along and says otherwise...