How to create installers with Maven

后端 未结 6 2091
离开以前
离开以前 2020-12-23 22:05

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 pac

相关标签:
6条回答
  • 2020-12-23 22:15

    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>
    
    0 讨论(0)
  • 2020-12-23 22:22

    There's some plugins out there that will do some of what you want.

    .deb

    .rpm

    nullsoft

    0 讨论(0)
  • 2020-12-23 22:22

    I'm looking into Installjammer - I don't see a maven plugin for it, but compared with izPack, it looks much more professional.

    0 讨论(0)
  • 2020-12-23 22:23

    I am not sure if i get the question right. Have you ever tried maven assembly?

    http://maven.apache.org/plugins/maven-assembly-plugin/

    That was i my first idea for your question.

    0 讨论(0)
  • 2020-12-23 22:28

    BitRock InstallBuilder can be used with Maven (and other CI build tools) to generate Windows exe installers, Linux binaries/RPM/DEB and OS X installers. It is commercial but we have discounts for small companies/solo developers and free licenses for open source projects (Disclaimer, I am the author of InstallBuilder)

    0 讨论(0)
  • 2020-12-23 22:30

    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/

    0 讨论(0)
提交回复
热议问题