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 touching JAVA_HOME, PATH, or settings.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:
Explicitly out of scope (now handled by #1017):
- General
JAVA_HOME / PATH skipping — use set-default: false.
Relationship / dependencies
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.
Add a "toolchains-only" install mode (layered on the
set-defaultprimitive)Background
PR #1017 introduces a
set-defaultinput: whenset-default: false, the action installs a JDK without updatingJAVA_HOME/PATH(while still exportingJAVA_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-defaultbut also contains a piece thatset-defaultdoes not cover. This issue captures that remaining gap so it can be built on top of theset-defaultprimitive rather than as a competing implementation.The gap not covered by
set-defaultset-default: falsecontrols 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: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, whentrue:toolchains.xml(existing toolchains logic).set-default: falsesemantics (does not updateJAVA_HOME/PATH) unless the user explicitly opts back in.settings.xml(nooverwrite-settingsside effects) unless explicitly requested.JAVA_HOME_<major>_<arch>(consistent withset-default: false).Explicitly out of scope (now handled by #1017):
JAVA_HOME/PATHskipping — useset-default: false.Relationship / dependencies
set-default) — should be implemented as a thin layer over that primitive, reusing its env-skip behavior instead of re-deriving it.Notes
PR #553 also proposed
update-env-javahome/update-env-pathas separate booleans; those are intentionally not carried forward —set-defaultfrom #1017 is the single, cleaner knob for that behavior. This issue deliberately narrows the remaining work to just the toolchains.xml-only capability.