To main content

Maven JLink Plugin Version 3.1.0 released

Published by Benjamin Marwell on

The Apache Maven team is pleased to announce the release of the Apache Maven JLink Plugin, version 3.1.0.

This plugin is used to create a JLink distribution using Maven. It is as easy as creating a jar file, but will instead create a zip file containing a reduced Java Runtime along with a launcher script, as well as the actual application of course. A JLink zip file is therefore platform dependent.

Disclosure: I am a maven committer, not a PMC member.

Quick Usage Guide

To create a module with a JLink zip file as its primary artifact, specify its packaging type and add the plugin as an extension:

<project …>
  <modelVersion>4.0.0</modelVersion>

  <packaging>jlink</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jlink-plugin</artifactId>
        <version>3.1.0</version>
        <extensions>true</extensions>
        <configuration>
          <!-- optionally, create a launcher -->
          <launcher>reactorapp=com.reactor.project.app/com.reactor.project.app.App</launcher>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

It is also possible to add a JLink zip file as an additional artifact to your project. Please note that at the moment you need to specify a classifier:

<project …>
  <modelVersion>4.0.0</modelVersion>

  <packaging>jar</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jlink-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <classifier>dist-${os}</classifier>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Download the Maven JLink Plugin

You can download the appropriate sources etc. from the download page:

https://maven.apache.org/plugins/maven-jlink-plugin/download.cgi

Changes and new features in version 3.1.0

Release Notes — Apache Maven JLink Plugin — Version 3.1.0

Bug

  • [MJLINK-54] - Compiler source/target for site generating does not work with 8
  • [MJLINK-55] - Pre Release Marker in Site must be changed

New Feature

  • [MJLINK-40] - Add support for --include-locales option
  • [MJLINK-41] - Add support for launcher script

Improvement

  • [MJLINK-36] - Use JLink via ToolProvider
  • [MJLINK-49] - Add support for single maven projects
  • [MJLINK-52] - Add support for classifiers
  • [MJLINK-53] - ITs should fail if no jlink binary is available
  • [MJLINK-56] - Convert unit tests to Junit5
  • [MJLINK-58] - Remove usage of plexus utils, use commons lang or native java instead.

Task

  • [MJLINK-60] - Website still shows PRE-RELEASE watermark

Dependency upgrade

  • [MJLINK-47] - Upgrade plexus-archiver to 4.2.3

Enjoy,

- The Apache Maven team