Just tried shade plugin, this<http://www.thekua.com/atwork/2008/10/generating-a-single-fat-jar-artifact-from-maven/>assembly plugin usage example, jar - maven-dependency-plugin combination, and fatjar - they all seem to do same thing, and it's not enough in some cases. Some libraries depend on their manifest metadata, like spring, and last man wins conflict resolution doesn't work in that case. I'm not legal expert but I think unpacking and repackaging libraries has legal consequences too.
One-jar v0.96 used by most recent onejar-maven-plugin has some class loader bugs which prevents spring framework component scan feature to work. That bug is present for quite some time, one-jar library doesn't seem to be actively maintained. IMO, Java, language of the Web, is not best option for CLI. Regards, Stevo. On Tue, Oct 13, 2009 at 7:44 PM, Albert Kurucz <[email protected]>wrote: > Which one is better? > > maven-jar-plugin/maven-dependency-plugin > maven-shade-plugin > onejar-maven-plugin > fatjar > > Why is that choice better than the other solutions? > Is the one which is "well maintained" always the better choice? > How do you define the "well maintained"-ness? > Just because it is debugged more frequently does it mean it is better? > It is possible that the other one did not have that much problems and > this is why it was not changed frequently. > > On Tue, Oct 13, 2009 at 10:58 AM, Will Hoover <[email protected]> > wrote: > > I would stick with the following maven-jar-plugin/maven-dependency-plugin > combo (also core plugins): > > > > <build> > > <plugins> > > <plugin> > > <artifactId>maven-jar-plugin</artifactId> > > <configuration> > > <archive> > > <manifest> > > > <mainClass>fully.qualified.MainClass</mainClass> > > </manifest> > > </archive> > > </configuration> > > </plugin> > > <plugin> > > <artifactId>maven-dependency-plugin</artifactId> > > <executions> > > <execution> > > <id>unpack-dependencies</id> > > <phase>package</phase> > > <goals> > > > <goal>unpack-dependencies</goal> > > </goals> > > </execution> > > </executions> > > </plugin> > > </plugins> > > <resources> > > <resource> > > > <directory>${basedir}/target/dependency</directory> > > </resource> > > </resources> > > </build> > > > > -----Original Message----- > > From: Mark Struberg [mailto:[email protected]] > > Sent: Tuesday, October 13, 2009 11:52 AM > > To: Maven Users List > > Subject: Re: Running Jar file created by Maven > > > > I'd use the maven-shade-plugin because a) it's a maven-core-plugin and as > such it's pretty well maintained b) it can also 'shade' concurring jars into > different packages if there are some dependency problems. > > > > LieGrue, > > strub > > > > --- On Tue, 10/13/09, Albert Kurucz <[email protected]> wrote: > > > >> From: Albert Kurucz <[email protected]> > >> Subject: Re: Running Jar file created by Maven > >> To: "Maven Users List" <[email protected]> > >> Date: Tuesday, October 13, 2009, 5:40 PM > >> Always nice to have choices. > >> Now, which one is better, the onejar-maven-plugin or > >> fatjar? > >> > >> On Tue, Oct 13, 2009 at 7:15 AM, Stevo Slavić <[email protected]> > >> wrote: > >> > http://code.google.com/p/onejar-maven-plugin/ > >> > > >> > http://anydoby.com/fatjar/ > >> > > >> > Regards, > >> > Stevo. > >> > > >> > On Tue, Oct 13, 2009 at 2:03 PM, Marcin Kwapisz < > [email protected]>wrote: > >> > > >> >> > but if I try to build it from the command > >> prompt using mvn > >> >> > install, > >> >> > it build the whole staff, but when I try to > >> run the jar file, it just > >> >> > fails > >> >> > becuase it cannot find the library files > >> (dependencies), looks like > >> >> > maven > >> >> > doesn't add those files, although it > >> downloads them... > >> >> > >> >> [Marcin Kwapisz] > >> >> Maven does not pack jar into jar. You can use > >> assembly plugin to do that > >> >> (as Eric Lewis wrote), but you can also use > >> dependency plugin to copy > >> >> dependencies (needed libraries) to you Target > >> directory (or directory where > >> >> your main jar is located). > >> >> > >> >> Regards > >> >> Marcin Kwapisz > >> >> > >> >> > >> >> > >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: [email protected] > >> >> For additional commands, e-mail: [email protected] > >> >> > >> >> > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
