Actually, the "include the world" problem was me having a bad dependency to some stufff... :-(
Does the shade plugin bundle all classes unpacked inside the jar? That usually becomes a bit clumsy... //Kent 2008/5/30 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Kent Närling schrieb: > > Hi! > > > > I would like to be able to build a self-sufficient application package > from > > a project into a zip/tar, ie with all dependencies and a prepared scrip > to > > execute it. > > > > I have so far tried two approches: > > > > A, Using maven-assembly-plugin and creating my own assembly file > > This has two problems: > > 1, I have set the dependency scope to runtime, but it still includes > > "the whole world"! > > I mean, it even includes a lot of maven jar:s! (which are > obviously > > not necessary to run the app) > > 2, It becomes very inconvenient to write the script and manually > > updating the jar:s that should be in the classpath... :-( > > > > B, Using the Mojo appassembler-maven-plugin, but this is very buggy... it > > even gives me nullpointer exceptions! :-( > > > > Anyone have tips about the best we to achive this? > > > > //Kent > > > > > I've not seen any problems with maven-assembly-plugin trying to include > jars used only by maven plugins. Are you sure that's what is happening? > Running "mvn dependency:tree" will show you what your projects > dependencies are. > > You might also want to look at the maven-shade-plugin. This can generate > an executable jar for a maven project, with all the necessary > dependencies bundled within it; very convenient. Unfortunately while the > plugin is great, the documentation is ****. It doesn't even mention this > very important feature. > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-shade-plugin</artifactId> > <version>1.1</version> > <executions> > <execution> > <phase>package</phase> > <goals> > <goal>shade</goal> > </goals> > </execution> > </executions> > </plugin> > > Just make sure that the manifest file has a "Main-Class: ..." and all > works nicely. > > Regards, > Simon > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Kent Närling System Developer SEAMLESS Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden Phone: +46 8 5648 7800, fax: +46 8 5648 7823 Mobile: +46 70 836 9925 Mail: [EMAIL PROTECTED] www.seamless.se
