Re: Packaging application with dependent jars?
On 1/4/07, matthewadams [EMAIL PROTECTED] wrote: I use the assembly plugin to create a jar that contains the contents of all jars that the application depends on. From my pom: [...] descriptorRefjar-with-dependencies/descriptorRef [...] Many things can be customized. See the doc on the assembly plug in (http://maven.apache.org/plugins/maven-assembly-plugin, http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html). Do you know, how to configure name of executable class so java -jar xxx-jar-with-dependencies.jar will work? I was checking if 'mainClass' element of maven-jar-plugin will be propagated to xxx-jar-with-dependencies.jar' but MANIFEST in result jar is do not contain anything from project, only three lines: Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: 1.5.0_07-b03 (Sun Microsystems Inc.) Regards, Tomek HTH, Matthew mxc wrote: Hi all, Is there a goal that will allow me to create a jar with all the dependencies so that I can just send it to people and give them a command line to run without them having to set their classpath? ie. java -jar myjar.jar? Thanks http://www.jumpingbean.co.za/java Jumping Bean -- View this message in context: http://www.nabble.com/Packaging-application-with-dependent-jars--tf2916305s177.html#a8154206 Sent from the Maven - Users mailing list archive at Nabble.com. - 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]
Re: Packaging application with dependent jars?
Hi all, Well this is what I have worked out. 1) Matthew's XML snippet runs the assembly as part of the build packaging process. To run it using the mvn assembly:assembly command you need to edit the pom.xml and add a configuration section. 2) You can use the default descriptor targets such as bin/jar-with-dependencies etc or you can write your own assembly.xml files and refer to them from your pom.xml. I.e under the plugin definition you include configuration descriptors descriptoryourassembly.xml /descriptor /descriptors /configuration I copied the default descriptor for the jar-with-dependencies target and edited my pom.xml appropriately. When I run mvn assembly:assembly I get the error [INFO] [INFO] An invalid artifact was detected. This artifact might be in your project's POM, or it might have been included transitively during the resolution process. Here is the information we do have for this artifact: o GroupID: za.co.jumpingbean o ArtifactID: appgen o Version: 1.0-SNAPSHOT o Type:jar [INFO] [INFO] Trace org.apache.maven.artifact.InvalidArtifactRTException: For artifact {za.co.jumpingbean:appgen:1.0-SNAPSHOT:jar}: An attached artifact must have a different ID than its corresponding main artifact. -- View this message in context: http://www.nabble.com/Packaging-application-with-dependent-jars--tf2916305s177.html#a8176705 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Packaging application with dependent jars?
Hi Mathew, Thanks for the help. I have added the above XML to my pom.xml. When I run the command [INFO] Unable to find descriptor: /home/mark/workspace/appgen/src/decriptor.xml (No such file or directory) -- View this message in context: http://www.nabble.com/Packaging-application-with-dependent-jars--tf2916305s177.html#a8173276 Sent from the Maven - Users mailing list archive at Nabble.com.
Packaging application with dependent jars?
Hi all, Is there a goal that will allow me to create a jar with all the dependencies so that I can just send it to people and give them a command line to run without them having to set their classpath? ie. java -jar myjar.jar? Thanks http://www.jumpingbean.co.za/java Jumping Bean -- View this message in context: http://www.nabble.com/Packaging-application-with-dependent-jars--tf2916305s177.html#a8149683 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Packaging application with dependent jars?
I use the assembly plugin to create a jar that contains the contents of all jars that the application depends on. From my pom: ... plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId executions execution phasepackage/phase configuration descriptorRefs descriptorRefjar-with-dependencies/descriptorRef /descriptorRefs /configuration goals goalsingle/goal /goals /execution /executions /plugin ... Many things can be customized. See the doc on the assembly plug in (http://maven.apache.org/plugins/maven-assembly-plugin, http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html). HTH, Matthew mxc wrote: Hi all, Is there a goal that will allow me to create a jar with all the dependencies so that I can just send it to people and give them a command line to run without them having to set their classpath? ie. java -jar myjar.jar? Thanks http://www.jumpingbean.co.za/java Jumping Bean -- View this message in context: http://www.nabble.com/Packaging-application-with-dependent-jars--tf2916305s177.html#a8154206 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]