You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Rose <of...@gmail.com> on 2005/06/15 02:46:27 UTC

A couple of application deployment questions

I'm newish to maven, although I managed to get my project moved over.

However, we have some requirements that none of the "Powered by Maven"
projects I've managed to find seem to handle.

First, we're making a home-user sort of application.  Ideally, we want
os-native executables to be launching this app.  We can generate the
executables using ant tasks, for the most part, but I'm not sure how
to integrate this into our build.

Second, and as a consequence of that, we want to create cross-platform
installers that will perform a seamless installation of our
application, along with its dependencies.  To this end, we need some
way of toting all of our dependencies with us in the distribution jar
file, or something equivalent.

>From what I can see of the projects that are powered by Maven, none of
them seem to use this sort of setup, and documentation is somewhat
hard to come by.

Can anyone using Maven tell me how they got those two things together?

-- 
Chris R.
======
Not to be taken literally, internally, or seriously.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: A couple of application deployment questions

Posted by Eric Black <eb...@gmail.com>.
Hi,

I'm not sure if this will be helpful, but for crossplatform
applications we have some goals that can create scripts for the
different os's. These are java specific, but you could have your own
scripts do whatever you wanted:


  <goal name="ccdist:make-run-script"
        description="Create runnable OS-specific batch files" >
    <ant:mkdir dir="target/dist"/>

    <j:set var="my.run.classpath.win">
      <j:forEach var="lib"
items="${pom.artifacts}">jars\${lib.file.name};</j:forEach>
    </j:set>

    <j:set var="my.run.classpath.unix">
      <j:forEach var="lib"
items="${pom.artifacts}">jars/${lib.file.name}:</j:forEach>
    </j:set>

    <j:file omitXmlDeclaration="true" name="target/dist/run.bat">

                java -Djava.library.path=nativelib -cp
"jars\${maven.final.name}.jar;${my.run.classpath.win}"
${maven.jar.mainclass} -f %1 %2 %3 %4 %5
    </j:file>

    <j:file omitXmlDeclaration="true" name="target/dist/run.sh">
                java -Djava.library.path=nativelib -cp
"jars/${maven.final.name}.jar:${my.run.classpath.unix}"
${maven.jar.mainclass} $$*
    </j:file>
  </goal>


You could also put any other files in the dist directory. Then we have
a zipping goal to zip up the dist directory:

  <goal name="ccdist:zip-dist" prereqs="ccdist:create-dist"
        description="Create a deployable zipped application" >
    <j:set var="prefix" value="${ccDist.output.prefix}" />

    <j:if test="${empty(prefix)}">
      <ant:fail message="ccDist.output.prefix property is undefined." />
    </j:if>

    <ant:zip destfile="target/${prefix}.zip">
      <zipfileset dir="target/dist" prefix="${prefix}"/>
    </ant:zip>
  </goal>


This is all Jelly stuff that works with Maven 1.0. Don't know if it
would work with Maven 2.

Eric



On 6/14/05, Chris Rose <of...@gmail.com> wrote:
> I'm newish to maven, although I managed to get my project moved over.
> 
> However, we have some requirements that none of the "Powered by Maven"
> projects I've managed to find seem to handle.
> 
> First, we're making a home-user sort of application.  Ideally, we want
> os-native executables to be launching this app.  We can generate the
> executables using ant tasks, for the most part, but I'm not sure how
> to integrate this into our build.
> 
> Second, and as a consequence of that, we want to create cross-platform
> installers that will perform a seamless installation of our
> application, along with its dependencies.  To this end, we need some
> way of toting all of our dependencies with us in the distribution jar
> file, or something equivalent.
> 
> From what I can see of the projects that are powered by Maven, none of
> them seem to use this sort of setup, and documentation is somewhat
> hard to come by.
> 
> Can anyone using Maven tell me how they got those two things together?
> 
> --
> Chris R.
> ======
> Not to be taken literally, internally, or seriously.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: A couple of application deployment questions

Posted by Eric Giguere <er...@videotron.ca>.
Hello Chriss
Chris Rose wrote:

>First, we're making a home-user sort of application.  Ideally, we want
>os-native executables to be launching this app.  We can generate the
>executables using ant tasks, for the most part, but I'm not sure how
>to integrate this into our build.
>  
>
Using a custom goal you will write in the maven.xml that will call you 
ant task to complete do the trick.

>Second, and as a consequence of that, we want to create cross-platform
>installers that will perform a seamless installation of our
>application, along with its dependencies.  To this end, we need some
>way of toting all of our dependencies with us in the distribution jar
>file, or something equivalent.
>  
>
Check out what the uber-dist plugin offers. This guy lets you build a 
custom distribution then zip (tar/gzip) it. It offers also ways to copy 
dependencies in custom publish directories. You can find the plugin and 
its doc at: http://uber-dist.sourceforge.net/

Hope it helps
Eric.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org