项目作者: Akman

项目描述 :
The JLink Maven Plugin lets you create a custom runtime image with the jlink tool introduced in Java 9
高级语言: Java
项目地址: git://github.com/Akman/jlink-maven-plugin.git
创建时间: 2020-05-18T20:58:06Z
项目社区:https://github.com/Akman/jlink-maven-plugin

开源协议:Apache License 2.0

下载


JLink Maven Plugin v0.1.11

Build Status
Maven Central
License

The jlink maven plugin lets you create a custom runtime image with
the jlink tool introduced in Java 9.

The main idea is to avoid being tied to project artifacts and allow the user
to fully control the process of creating an image. However, it is possible,
of course, to customize the process using project artifacts.

The detailed documentation for this plugin is available here.

Goals

This plugin has two goals:

  • jlink:jlink 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.

  • jlink:help display help information on the plugin.

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

  1. mvn jlink:jlink

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

To display parameter details execute:

  1. mvn jlink:help -Ddetail=true

Usage

Add the plugin to your pom:

  1. <project>
  2. ...
  3. <build>
  4. <pluginManagement>
  5. <plugins>
  6. ...
  7. <plugin>
  8. <groupId>com.github.akman</groupId>
  9. <artifactId>jlink-maven-plugin</artifactId>
  10. <version>0.1.11</version>
  11. </plugin>
  12. ...
  13. </plugins>
  14. </pluginManagement>
  15. </build>
  16. ...
  17. <plugins>
  18. ...
  19. <plugin>
  20. <groupId>com.github.akman</groupId>
  21. <artifactId>jlink-maven-plugin</artifactId>
  22. <executions>
  23. <execution>
  24. <phase>verify</phase>
  25. <goals>
  26. <goal>jlink</goal>
  27. </goals>
  28. <configuration>
  29. <!-- put your configurations here -->
  30. </configuration>
  31. </execution>
  32. </executions>
  33. </plugin>
  34. ...
  35. </plugins>
  36. ...
  37. </project>

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

  1. <project>
  2. ...
  3. <pluginRepositories>
  4. <pluginRepository>
  5. <id>ossrh</id>
  6. <name>OSS Sonatype Snapshots Repository</name>
  7. <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  8. <layout>default</layout>
  9. <snapshots>
  10. <enabled>true</enabled>
  11. </snapshots>
  12. <releases>
  13. <enabled>false</enabled>
  14. </releases>
  15. </pluginRepository>
  16. </pluginRepositories>
  17. ...
  18. </project>

And then build your project, jlink starts automatically:

  1. mvn clean verify

The JLink tool official description.

JEP-220 Modular runtime images.

Pull request

Pull request template: .github/pull_request_template.md.