Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create installers with Maven

Tags:

I'm migrating a medium sized Java application's build from Ant to Maven. I could easily migrate the basic building stuff, but I would also like to create the installer packages from the Maven build. The easiest way would be to call the original Ant scripts through the Ant plugin, but I thought maybe I should look around first for some Maven support.

I'd need to create several different installers for different platforms:

  • Windows 32/64 bit
  • Linux 32/64 bit
  • MacOS 32/64 bit

For Linux now I think we only have a tar.gz and some Bash scripts to start the daemons - a Debian/RPM package would be much nicer, maybe with dependent package definitions, too. For the Windows installers we use NullSoft installer. I have no idea how the MacOS bundle is assembled now.

Are there any tools out there to do this (or at least part of it) from Maven?

like image 235
Lóránt Pintér Avatar asked Sep 04 '09 09:09

Lóránt Pintér


2 Answers

I'd use the IzPack maven plugin if you need a full-blown installer, or the appassembler-maven-plugin if you simply need to generate daemons for java services.

There are also plugins for NSIS, Debian, and RPM packaging, but using those means you have to maintain configurations for each platform, on the other hand IzPack allows you to generate an installer for Windows XP / Vista / 2003 / 2000, Mac OS X, Solaris, Linux and *BSD.


The appassembler plugin provides a goal to generate JSW daemons for each platform. Here is an example configuration:

<plugin>   <groupId>org.codehaus.mojo</groupId>   <artifactId>appassembler-maven-plugin</artifactId>   <version>1.0</version>   <execution>     <id>generate-jsw-scripts</id>     <phase>package</phase>     <goals>       <goal>generate-daemons</goal>     </goals>     <configuration>       <daemons>         <daemon>           <id>myApp</id>           <mainClass>name.seller.rich.MainClass</mainClass>           <commandLineArguments>             <commandLineArgument>start</commandLineArgument>           </commandLineArguments>           <platforms>             <platform>jsw</platform>           </platforms>                       </daemon>       </daemons>       <target>${project.build.directory}/appassembler</target>     </configuration>   </execution> </plugin> 
like image 119
Rich Seller Avatar answered Oct 10 '22 10:10

Rich Seller


You could use IzPack and the IzPack maven plugin for that purpose. It works quite well for me: http://izpack.codehaus.org/izpack-maven-plugin/

like image 29
Kutzi Avatar answered Oct 10 '22 09:10

Kutzi