Repository navigation
Add a "toolchains-only" install mode (layered on the set-default primitive) #1047
Description
Add a "toolchains-only" install mode (layered on the set-default primitive)
Background
PR #1017 introduces a set-default input: when set-default: false, the action installs a JDK without updating JAVA_HOME / PATH (while still exporting JAVA_HOME_<major>_<arch>). That cleanly covers the "don't make this JDK the environment default" use case (issue #560).
The earlier PR #553 (issue #552) aimed at a broader, Maven-centric goal that partially overlaps with set-default but also contains a piece that set-default does not cover. This issue captures that remaining gap so it can be built on top of the set-default primitive rather than as a competing implementation.
The gap not covered by set-default
set-default: false controls the environment (JAVA_HOME / PATH). It does not, on its own, add the installed JDK as a Maven toolchain entry. The use case from #552 / #553 is:
Install a JDK and register it only as a Maven toolchain (
~/.m2/toolchains.xml) — without touchingJAVA_HOME,PATH, orsettings.xml.
This is useful when a workflow needs an additional JDK available to Maven's maven-toolchains-plugin (e.g. compiling/running a module against a specific JDK) while leaving the workflow's primary Java environment untouched.
Proposed scope (narrowed)
Add a focused input — e.g. add-toolchain-only (name TBD) — that, when true:
- Adds/updates the JDK entry in
toolchains.xml(existing toolchains logic). - Implies
set-default: falsesemantics (does not updateJAVA_HOME/PATH) unless the user explicitly opts back in. - Does not modify
settings.xml(nooverwrite-settingsside effects) unless explicitly requested. - Still exports
JAVA_HOME_<major>_<arch>(consistent withset-default: false).
Explicitly out of scope (now handled by #1017):
- General
JAVA_HOME/PATHskipping — useset-default: false.
Relationship / dependencies
- Depends on / builds on: feat: Add set-default option #1017 (
set-default) — should be implemented as a thin layer over that primitive, reusing its env-skip behavior instead of re-deriving it. - Supersedes (scope-wise): the toolchains-only portion of PR Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular #553.
- Original request: Allow to add a toolchain only - without updating settings.xml, JAVA_HOME and PATH. Only toolchains.xml must be extended. #552.
Notes
PR #553 also proposed update-env-javahome / update-env-path as separate booleans; those are intentionally not carried forward — set-default from #1017 is the single, cleaner knob for that behavior. This issue deliberately narrows the remaining work to just the toolchains.xml-only capability.
Activity
mhoffrog commentedon Jul 14, 2026
@brunoborges This issue can now be closed as resolved, since the use case is covered by #1111, disabling defaults update by
set-default: falseand disabling settings update byoverwrite-settings: false.