maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Uber jar considered harmful?
Date Mon, 01 Dec 2014 17:14:23 GMT
It all depends how you use them.

There are some use cases where they make sense.

Usually these use cases include aggressive shading of the dependencies you
are bundling.

Some cases where it can be useful:

* If you are interfacing with a non-maven aware build tool chain - here the
uberjar makes life easier for that toolchain as they only have one
dependency to specify... the gotcha is if you make this the only way for
people to consume then the POM aware build toolchains will end up with
duplicate class hell

* If you are creating an "App" or CLI utility jar file where people just
run the file directly then it can be easier to give them a single jar
file... but anyone else embedding your "app" will curse you if you only
provide the uberjar

On 1 December 2014 at 16:59, Benson Margulies <bimargulies@gmail.com> wrote:

> I don't know about 'harmful', but there are certainly some good ways to
> shoot your toes off.
>
> My convention is that I only use shaded jars as exports to the non-Maven
> world, I discourage using shaded jars as part of a larger dependency graph.
> I could detail some mishaps which motivated that convention if anyone
> cares.
>
> On Mon, Dec 1, 2014 at 11:36 AM, Ron Wheeler <
> rwheeler@artifact-software.com
> > wrote:
>
> > I wrote this in 2011
> > http://blog.artifact-software.com/tech/?p=121
> > which describe our use of aggregation jars.
> > It is, of course, focused on the wonderful advantages that these offer.
> >
> > It may have prompted the discussion that you recall so this might give
> you
> > a time-frame to narrow your search.
> >
> > I may be wrong but I think that Stephen Connolly and Wayne Fay raised
> some
> > issues with the approach. The word "anti-pattern" may have come up.:-)
> >
> > Perhaps this will jog some memories.
> >
> > Ron
> >
> >
> > On 01/12/2014 10:59 AM, Jeffrey E Care wrote:
> >
> >> I seem to recall a post in the not too distant past where is was at
> least
> >> implied (if not outwardly stated) that the use of uber jars was an
> >> anti-practice. Unfortunately I can't find it now and my google-fu is
> >> failing me.
> >>
> >> Am I making this up? Can anyone confirm my recollection?
> >>
> >> Is there a best-practice recommendation re. uber jars that is generally
> >> recognized in the Maven community?
> >>
> >> ------------------------------------------------------------------------
> >> *Jeffrey E. (Jeff) Care*
> >> Advisory Software Engineer | IBM Watson Implementations Release
> >> Engineering
> >> carej@us.ibm.com <mailto:carej@us.ibm.com>| External: 919-543-4907 |
> Tie
> >> line: 441-4907
> >>         <http://www.facebook.com/ibmwatson><https://twitter.
> >> com/@ibmwatson><http://www.youtube.com/user/IBMWatsonSolutions/videos>
> >>
> >>
> >>
> >
> > --
> > Ron Wheeler
> > President
> > Artifact Software Inc
> > email: rwheeler@artifact-software.com
> > skype: ronaldmwheeler
> > phone: 866-970-2435, ext 102
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message