Talk:Maven
From APIDesign
(Comment provided by Laszlo Kishalmi - via ArticleComments extension) |
|||
Line 110: | Line 110: | ||
<div class='commentBlock'> | <div class='commentBlock'> | ||
- | If someone needs a clumsy Ant | + | If someone needs a clumsy Ant snippet for the [[LibrariesAndClassPathBuildProblem]], here it is: |
+ | <source lang="xml"> | ||
<copy todir="${dist.dir}/lib" flatten="true"> | <copy todir="${dist.dir}/lib" flatten="true"> | ||
<fileset dir="${basedir}/lib" includes="**/*.jar"/> | <fileset dir="${basedir}/lib" includes="**/*.jar"/> | ||
Line 123: | Line 124: | ||
</manifest> | </manifest> | ||
</jar> | </jar> | ||
- | + | </source> | |
--Laszlo Kishalmi 22:13, 15 September 2009 (CEST) | --Laszlo Kishalmi 22:13, 15 September 2009 (CEST) | ||
+ | |||
+ | Thanks Laszlo, I am creating a [[LibrariesAndClassPathBuildProblem|separate page]] with your code! | ||
+ | |||
+ | --[[User:JaroslavTulach|JaroslavTulach]] 05:50, 16 September 2009 (UTC) | ||
+ | |||
</div> | </div> |
Revision as of 05:50, 16 September 2009
Comments on Maven <comments />
Contents |
Dimiter Makariev said ...
Anuradha said ...
did you try out Maven Assembly Plugin
http://maven.apache.org/plugins/maven-assembly-plugin/
--Anuradha 04:43, 14 September 2009 (CEST)
btilford said ...
You probably want to look at maven assemblies and the maven book. http://www.sonatype.com/books/maven-book/reference/assemblies.html
--btilford 05:35, 14 September 2009 (CEST)
mkleint said ...
your time would probably be better spent by reading the Maven book to learn about Maven than writing this blog entry..
--mkleint 07:45, 14 September 2009 (CEST)
nick said ...
What you want to look at is the assembly plugin. While I don't think it will give you a zip file, it will let you pack everything into a JAR and for a executable JAR that can be downloaded. It handles extracting all your dependencies and putting them in place.
Looking for something like this: <artifactId>maven-assembly-plugin</artifactId>
<configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs>
....
Hope this helps!
--nick 15:16, 14 September 2009 (CEST)
Chris said ...
Check out the assembly plugin
--Chris 16:50, 14 September 2009 (CEST)
hohonuuli said ...
Maven does support packaging of compound zips. See http://maven.apache.org/plugins/maven-assembly-plugin/
--hohonuuli 18:52, 14 September 2009 (CEST)
Sgt Garcia said ...
I am using Maven Assembly Plugin with success to gather everything I to run a Desktop App: Start Script files (.bat, .sh, .jnlp...), Main .jar, Libraries .jars, Config files (.properties)...
--Sgt Garcia 18:57, 14 September 2009 (CEST)
zerem said ...
Hi, had some similar problems back then. I'm using maven for releasing desktop application for 3yrs now. Here r my notes for your suffering ;)
Single zip: http://maven.apache.org/plugins/maven-assembly-plugin (for multipple, keyword is overlay)
Main class: http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Add
Adding dependencies: http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
all within standard plugins... if u want some more info (ex. pices of pom.xml) post me e-mail...
Don't give up on Maven, its just another way of thinking (a better one actually ;))
And final word: if u need some special work done, writing your own plugin is commonly faster than searching for solution... damn easy.
--zerem 19:49, 14 September 2009 (CEST)
Thank you all for your responses. Based on them I studied the recommended book and modified the pom.xml. Thanks a lot.
--JaroslavTulach 08:40, 15 September 2009 (UTC)
Laszlo Kishalmi said ...
If someone needs a clumsy Ant snippet for the LibrariesAndClassPathBuildProblem, here it is:
<copy todir="${dist.dir}/lib" flatten="true"> <fileset dir="${basedir}/lib" includes="**/*.jar"/> </copy> <pathconvert property="main.jar.class-path" dirsep="/" pathsep=" "> <path><fileset dir="${dist.dir}" includes="lib/*.jar"/></path> <map from="${dist.dir}/" to=""/> </pathconvert> <jar update="true" jarfile="${dist.dir}/main.jar"> <manifest> <attribute name="Class-Path" value="${main.jar.class-path}"/> </manifest> </jar>
--Laszlo Kishalmi 22:13, 15 September 2009 (CEST)
Thanks Laszlo, I am creating a separate page with your code!
--JaroslavTulach 05:50, 16 September 2009 (UTC)
Hi, probably a good idea is to try the maven assembly plugin : http://maven.apache.org/plugins/maven-assembly-plugin/features.html also take a look at : http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html Better Builds with Maven is great book : http://www.maestrodev.com/better-build-maven and last but not least : you can always go back to ant with the Maven ant plugin : http://maven.apache.org/plugins/maven-antrun-plugin/
I'm coming from the web development world .. so for a pity I cannot comment on the question about is maven ready for java desktop applications.
Wish you luck with Maven :)
--Dimiter Makariev 02:13, 14 September 2009 (CEST)