Skip to content

The jpackage maven plugin lets you create a custom runtime image/installer with the jpackage tool introduced in Java 14.

License

Notifications You must be signed in to change notification settings

Akman/jpackage-maven-plugin

Repository files navigation

JPackage Maven Plugin v0.1.5

Build Status Maven Central License

The jpackage maven plugin lets you create a custom runtime image/installer with the jpackage tool introduced in Java 14.

The main idea is to avoid being tied to project artifacts and allow the user to fully control the process of creating an image/installer.

The detailed documentation for this plugin is available here.

Goals

This plugin has two goals:

  • jpackage:jpackage is not bound to any phase within the Maven lifecycle and is therefore is not automatically executed, therefore the required phase must be specified explicitly.

  • jpackage:help display help information on the plugin.

To create a custom runtime image/installer manually you need only to execute:

mvn jpackage:jpackage

It will not fork (spawn a parallel) an alternate build lifecycle and will execute the jpackage goal immediately.

To display parameter details execute:

mvn jpackage:help -Ddetail=true

Usage

Add the plugin to your pom:

  <project>
    ...
    <build>
      <pluginManagement>
        <plugins>
          ...
          <plugin>
            <groupId>com.github.akman</groupId>
            <artifactId>jpackage-maven-plugin</artifactId>
            <version>0.1.5</version>
          </plugin>
          ...
        </plugins>
      </pluginManagement>
    </build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>com.github.akman</groupId>
        <artifactId>jpackage-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jpackage</goal>
            </goals>
            <configuration>
              <!-- put your configurations here -->
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
    ...
  </project>

If you want to use snapshot versions of the plugin connect the snapshot repository in your pom.xml.

  <project>
    ...
    <pluginRepositories>
      <pluginRepository>
        <id>ossrh</id>
        <name>OSS Sonatype Snapshots Repository</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <layout>default</layout>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
        <releases>
          <enabled>false</enabled>
        </releases>
      </pluginRepository>
    </pluginRepositories>
    ...
  </project>

And then build your project, jpackage starts automatically:

mvn clean verify

Links

The JPackage tool official description.

Pull request

Pull request template: .github/pull_request_template.md.