Re: Maven 2 : Jar with included Jar dependencies
Not really difficult : plugin !-- NOTE: We don't need a groupId specification because the group is org.apache.maven.plugins ...which is assumed by default. -- artifactIdmaven-assembly-plugin/artifactId configuration descriptorRefs descriptorRefjar-with-dependencies/descriptorRef /descriptorRefs archive manifest mainClasssample.soapwithattachments.client.SWAClient/mainClass /manifest /archive /configuration executions execution idmake-assembly/id!-- this is used for inheritance merges -- phasepackage/phase!-- append to the packaging phase. -- goals goalattached/goal!-- goals == mojos -- /goals /execution /executions Arnaud /plugin On 12/09/2007, Annies, Sebastian [EMAIL PROTECTED] wrote: We do this by hand since the assembly plugin is too hard to use. You may give it a try: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId executions !-- Copy this project's dependencies to the release/lib directory -- execution idcopy-dependencies/id phasepackage/phase goals goalcopy-dependencies/goal /goals configuration outputDirectory${project.build.directory}/release-${ project.version}/lib/outputDirectory includeScoperuntime/includeScope overWriteIfNewertrue/overWriteIfNewer /configuration /execution /executions /plugin !-- Zip the release -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId executions execution idpackageApp/id phasepackage/phase configuration tasks copy file=${project.build.directory}/${ project.artifactId}-${project.version}.jar todir=target/release-${ project.version}/ / zip destfile=${project.build.directory}/isoviewer-${ project.version}.zip zipfileset dir=target/release-${project.version}/ prefix=isoviewer includes=**/* / /zip /tasks /configuration goals goalrun/goal /goals /execution /executions /plugin !-- Deploy and Install the created ZIP file -- plugin groupIdorg.codehaus.mojo/groupId artifactIdbuild-helper-maven-plugin/artifactId executions execution idattach-artifacts/id phasepackage/phase goals goalattach-artifact/goal /goals configuration artifacts artifact file${project.build.directory}/isoviewer-${ project.version}.zip/file typezip/type classifierbin/classifier /artifact /artifacts /configuration /execution /executions /plugin !-- Create executable jar -- plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration archive manifest mainClassiso.gui.Main/mainClass addClasspathtrue/addClasspath classpathPrefixlib/classpathPrefix /manifest /archive /configuration /plugin /plugins /build -Ursprüngliche Nachricht- Von: zm [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. September 2007 22:24 An: users@maven.apache.org Betreff: Maven 2 : Jar with included Jar dependencies Hi, I'm trying to create a jar using Maven 2, but I'm not getting what I whant to ... I have a jar project (main.jar) that depends on another jar (common.jar). My poms are working correctly, but I need to create a self dependant main.jar . That is, I need main.jar to include the common.jar, and access it without any other external classpath info. I just want to execute java -jar main.jar and voila ... executes nicelly. Googling around I found no solution for the base jar feature, but I heard about plugins for Maven ... UberJar and JavaApp. Both should work fine with Maven 1.x. I'm using Maven 2.0.7, and I've read somewhere around my googling that this jar included dependencies are already available in the base Maven 2 framework. Now I just need some help to put it to works, as googling around is bringing me many results that does not interest me, and maybe you know how to do it, or point me to some link that helps ... I'm new to Maven, and I
Re: Maven 2 : Jar with included Jar dependencies
In maven 2 you can create an all-in-one jar with the assembly plugin http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies Arnaud On 11/09/2007, zm [EMAIL PROTECTED] wrote: Hi, I'm trying to create a jar using Maven 2, but I'm not getting what I whant to ... I have a jar project (main.jar) that depends on another jar (common.jar). My poms are working correctly, but I need to create a self dependant main.jar . That is, I need main.jar to include the common.jar, and access it without any other external classpath info. I just want to execute java -jar main.jar and voila ... executes nicelly. Googling around I found no solution for the base jar feature, but I heard about plugins for Maven ... UberJar and JavaApp. Both should work fine with Maven 1.x. I'm using Maven 2.0.7, and I've read somewhere around my googling that this jar included dependencies are already available in the base Maven 2 framework. Now I just need some help to put it to works, as googling around is bringing me many results that does not interest me, and maybe you know how to do it, or point me to some link that helps ... I'm new to Maven, and I really want to learn how to use it properly ... the fact is that I also find it very difficult sometimes to find info about pluggins, how to use them, their settings/usage ... Anyway, any help regarding jars inside jars :) would be greatly appreciated. Thanks. -- View this message in context: http://www.nabble.com/Maven-2-%3A-Jar-with-included-Jar-dependencies-tf4425083s177.html#a12622970 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- .. Arnaud HERITIER .. OCTO Technology - aheritier AT octo DOT com www.octo.com | blog.octo.com .. ASF - aheritier AT apache DOT org www.apache.org | maven.apache.org ...