Jlink support for Java plugin
Metadata
Current evaluation
Replaced the proposed Java-plugin integration with a dedicated Jlink plugin, added in PR #951 (commit ba3891a0).
Resolution: closed superseded
Reason: Maintainers agreed that a general Jlink plugin should combine jars from multiple Java parts rather than extend the Java plugin. PR #951 implemented that dedicated plugin in commit ba3891a0.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### What needs to get done
Java plugin should set JAVA_HOME https://github.com/canonical/craft-parts/issues/891 and provide a way to generate runtime for the Java application.
This can be done by running `jlink` and passing a list of jar files. Java plugin by default copies files to `$CRAFT_PART_INSTALL/jars` and java plugin will pick up jars from this location in post build commands and generate the runtime for those jars. User should be able to specify the version of the Java to use and list of jar files and directories if the default value is not acceptable. User should be able to specify if he wants to run a jlink step.
Java should be available as a plugin so that build without applying derivative plugins is supported.
- register Java as a plugin.
```
parts:
foo:
plugin: java
jlink: true
jlink_java_version: 21
jlink_jars:
- $CRAFT_PART_INSTALL/jar/jar1.jar
- $CRAFT_PART_BUILD/jar/jar2.jar
```
- The plugin should install chisel slices into a build root (otherwise it affects build JDK)
- The plugin should use chiselled runtime to generate jlink runtime.
### Why it needs to get done
To have a lean runtime for java applications
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Replaced the proposed Java-plugin integration with a dedicated Jlink plugin, added in PR #951 (commit ba3891a0). | |
| stealth/space-bunny-alpha | — | closed superseded | Superseded by a dedicated jlink plugin proposal to combine jars from multiple Java parts into one lean runtime instead of extending the Java plugin. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The Java plugin proposal was superseded by a dedicated jlink plugin. It will generate lean runtimes across multiple parts. Extensions and build attributes were rejected due to parameter and multi-part processing limits. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The team rejected the proposed Java wrapper plugin and agreed to implement a separate, general jlink plugin instead. This new plugin will generate lean runtimes for multiple parts using its own properties and existing after behavior. | |
| qwen/qwen3.6-35b-a3b | — | — | Superseded by a design decision to implement a dedicated jlink plugin instead. The team agreed a standalone jlink plugin best generates lean runtimes for multiple parts, as extensions and build attributes cannot support the required multi-part parameters. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | The Java plugin jlink proposal was superseded. The team decided to implement a standalone jlink plugin instead, enabling lean runtime generation across multiple parts without modifying the existing Java plugin. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
canonical/craft-parts#951
(confidence 98%)
The dedicated Jlink plugin superseded the original Java-plugin design and implemented the requested runtime generation.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #951 feat: implement Jlink plugin | craft-parts | merged | PR #951 merged as commit ba3891a0, adding the Jlink plugin with unit and integration tests, documentation, and support for building lean Java runtimes. | |
| #824 Please support plugin to generate java runtime for Java application | craft-parts | closed | Closed in favor of #891, which delivered a dedicated Jlink plugin through merged PR #951 (commit ba3891a0). |