GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular by mhoffrog · Pull Request #553 · actions/setup-java

Conversation

@mhoffrog

@mhoffrog mhoffrog commented Nov 7, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

09-Nov-2023: Amended commit comments only.

Description:
The following input items have been added (copied from README.md update):

  • update-env-javahome: By default action updates env.JAVA_HOME with the path of java installed. In order to skip update of JAVA_HOME, set this to false. The creation of the env variable JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }} is NOT affected by this item. That will be created for any setup.

  • update-env-path: By default action adds <java_install_dir>/bin to env.PATH. In order to skip this, set this to false.

  • update-toolchains-only: If set to true, then overwrite-settings, update-env-javahome and update-env-path are propagated to false if the specific one is not explicitly configured to true. Only a toolchain entry will be added to toolchains.xml. Default is false.

Summary on a few code improvements (Inserted by 09-Nov-2023):
By that implementation I did a few code improvements as follows:

  • setup-java.ts:
    • renamed interface installerInputsOptions -> IInstallerInputsOption and moved the definition to the top of the source file to levarage readability
  • input values for overwrite-settings - plus the ones I did add - are read now once only in a single code place (within setup-java.ts only) to a constant and pass their effective values either by method parameters or by object fields to other places during the runtime lifecycle
  • variable naming within toolchains.ts
  • minor improvements of wording on log messages regarding toolchains.xml updates.

Further particular details on the code changes can be taken from my commit comment b0dadd2.

Related issue:
#552

Check list:

  • Mark if documentation changes are required.
    💡 Documentation has been updated by this PR
  • Mark if tests were added or updated to cover the changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

764653880 and Okeanos reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@mhoffrog
mhoffrog requested a review from a team as a code owner November 7, 2023 14:46
@mhoffrog mhoffrog changed the title Add a toolchain only - control update of settings.xml, JAVA_HOME and PATH more granular Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular Nov 8, 2023
@IvanZosimov IvanZosimov linked an issue Nov 8, 2023 that may be closed by this pull request
Allow to add a toolchain only - without updating settings.xml, JAVA_HOME and PATH. Only toolchains.xml must be extended. #552
Closed
@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch 2 times, most recently from 1c8123d to e7b1371 Compare November 8, 2023 22:39
@mhoffrog

mhoffrog commented Dec 28, 2023

Copy link
Copy Markdown
Contributor Author

@IvanZosimov is there anything I can do in addition to get this PR merged?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch 2 times, most recently from 3f983c4 to 230bb6e Compare January 31, 2024 18:24
@mhoffrog

mhoffrog commented Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog mhoffrog mentioned this pull request Feb 28, 2024
Allow to add a toolchain only - without updating settings.xml, JAVA_HOME and PATH. Only toolchains.xml must be extended. #552
Closed
@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 230bb6e to 598ae60 Compare February 29, 2024 20:42
@mhoffrog

mhoffrog commented Feb 29, 2024

Copy link
Copy Markdown
Contributor Author

@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from b8f4969 to 993bbb6 Compare April 7, 2024 18:02
@mhoffrog

mhoffrog commented Apr 7, 2024

Copy link
Copy Markdown
Contributor Author

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 4f3734a to 2f3fa47 Compare July 19, 2024 10:45
@mhoffrog

mhoffrog commented Jul 19, 2024

Copy link
Copy Markdown
Contributor Author

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 2f3fa47 to 8bb7cab Compare August 23, 2024 21:51
@mhoffrog

mhoffrog commented Aug 23, 2024

Copy link
Copy Markdown
Contributor Author

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch 2 times, most recently from 7425697 to cb67ffd Compare December 15, 2024 17:02
@mhoffrog

mhoffrog commented Dec 15, 2024

Copy link
Copy Markdown
Contributor Author

@mahabaleshwars @aparnajyothi-y @HarithaVattikuti FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from cb67ffd to 1e22074 Compare December 22, 2024 21:18
@mhoffrog

mhoffrog commented Dec 22, 2024

Copy link
Copy Markdown
Contributor Author

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 1e22074 to 774eb61 Compare May 1, 2025 22:03
@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 774eb61 to 48a9cd5 Compare September 1, 2025 09:34
@mhoffrog

mhoffrog commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

@clarkbw FYI - rebased to main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 4473697 to 7b7c442 Compare September 25, 2025 07:54
@mhoffrog

mhoffrog commented Sep 25, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@aparnajyothi-y, @HarithaVattikuti - FYI - re-based to main

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 7b7c442 to 483ac56 Compare November 23, 2025 16:48
@mhoffrog

mhoffrog commented Nov 23, 2025

Copy link
Copy Markdown
Contributor Author

@mahabaleshwars @aparnajyothi-y @HarithaVattikuti - FYI - re-based to main

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog mhoffrog mentioned this pull request Nov 23, 2025
Allow to install multiple JDK distributions #945
Closed
@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 483ac56 to 915dff3 Compare January 4, 2026 17:09
@mhoffrog

mhoffrog commented Jan 4, 2026

Copy link
Copy Markdown
Contributor Author

@priyagupta108 @mahabaleshwars @aparnajyothi-y @HarithaVattikuti - FYI - re-based to main

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 915dff3 to 1d68cf3 Compare April 15, 2026 22:24
@mhoffrog

mhoffrog commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@priyagupta108 @mahabaleshwars @aparnajyothi-y @HarithaVattikuti - FYI - re-based to main

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@v-priya-kinthali

v-priya-kinthali commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Hello @mhoffrog👋,
Thank you for your contribution, and apologies for the delayed response. As mentioned in #552, we’ll consider exploring the possibility of incorporating these changes in a future update as we gather more community engagement and interest.
Thanks again for your input and patience!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mhoffrog added 3 commits June 18, 2026 13:13
@mhoffrog
Add inputs 'update-toolchains-only', 'update-env-javahome', 'add-to-e…
7d2624f
…nv-path'

Changes in detail:
------------------
- action.yml:
  - add inputs:
    - update-toolchains-only
    - update-env-javahome
    - add-to-env-path
  - update description for input "overwrite-settings"
  - remove default value of input "overwrite-settings",
    since the default is now propagated from input 'update-toolchains-only'

- base-models.ts:
  - extend interface JavaInstallerOptions:
    - add fields:
      - updateEnvJavaHome: boolean;
      - addToEnvPath: boolean;

- constants.ts:
  - add constant INPUT_UPDATE_TOOLCHAINS_ONLY
    = 'update-toolchains-only'

- auth.ts:
  - function configureAuthentication():
    - add parameter:
      - overwriteSettings: boolean
    - remove the now obsolete const overwriteSettings

- toolchains.ts:
  - function configureToolchains(...):
    - add parameter updateToolchains: boolean
    - remove the now obsolete const overwriteSettings
  - improve variable naming:
    - rename any occurrence of 'overwriteSettings'
        by 'updateToolchains'
    - add field updateToolchains: boolean to the parameter object
  - function writeToolchainsFileToDisk(...):
    - improve variable naming:
      - rename variable 'settingsExists'
          by 'toolchainsExists'
    - update wording of info logs to be more applicable

- setup-java.ts:
  - interface installerInputsOptions:
    - rename to IInstallerInputsOption to meet common coding convention
    - add fields:
      - updateToolchainsOnly: boolean;
      - overwriteSettings: boolean;
      - updateEnvJavaHome: boolean;
      - addToEnvPath: boolean;
  - function run():
    - add const:
      - const updateToolchainsOnly:
        - get as boolean from input 'update-toolchains-only', default: false
      - const overwriteSettings:
        - get as boolean from input 'overwrite-settings', default: !updateToolchainsOnly
      - const updateEnvJavaHome:
        - get as boolean input 'update-env-javahome', default: !updateToolchainsOnly
      - const addToEnvPath:
        - get as boolean input 'add-to-env-path', default: !updateToolchainsOnly
   - extend const installerInputsOptions to match with IInstallerInputsOption:
      - add field updateToolchainsOnly
      - add field overwriteSettings
      - add field updateEnvJavaHome
      - add field addToEnvPath
    - update call of auth.configureAuthentication()
        to auth.configureAuthentication(overwriteSettings)
  - function installVersion(...):
    - add const and init from parameter options:
      - updateToolchainsOnly, overwriteSettings,
        updateEnvJavaHome, addToEnvPath
    - init the additional fields of installerInputsOptions accordingly
    - call toolchains.configureToolchains(...):
      - with parameter updateToolchains= overwriteSettings || updateToolchainsOnly

- base-installer.ts:
  - add constants to import from constants:
    - INPUT_UPDATE_JAVA_HOME
    - INPUT_ADD_TO_PATH
  - add fields:
    - protected updateEnvJavaHome: boolean;
    - protected addToEnvPath: boolean;
  - ctor:
    - init these fields from JavaInstallerOptions accoprdingly
  - function setJavaDefault(...):
    - if updateEnvJavaHome is false:
      - SKIP updating env.JAVA_HOME
      - log info:
        `Skip updating env.JAVA_HOME according to ${INPUT_UPDATE_JAVA_HOME}`
    - if addToEnvPath is false:
      - SKIP adding toolchain path to env.PATH
      - log info:
        `Skip adding to env.PATH according to ${INPUT_ADD_TO_PATH}`
@mhoffrog
Update README.md
b7182b5
@mhoffrog
Update from npm run format to fix prettier check
b608e51
- missed in initial commit
- took re-built dist from GH actions
@mhoffrog
mhoffrog force-pushed the mhoffrog/552_allow_to_add_a_toolchain_only branch from 491467d to b608e51 Compare June 18, 2026 11:27
@mhoffrog

mhoffrog commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Re-based to main.

Run of Check dist passed after recent force commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brunoborges brunoborges added feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth labels Jun 22, 2026
@Okeanos Okeanos mentioned this pull request Jun 22, 2026
fix: Maven Toolchains grows unexpectedly #534
Merged
1 of 2 tasks
This was referenced Jun 23, 2026
Add a "toolchains-only" install mode (layered on the set-default primitive) #1047
Closed
feat: Add set-default option #1017
Merged
@brunoborges

brunoborges commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for this work, @mhoffrog — and apologies it sat for so long. Closing it now, but the ideas live on; here's how we're routing them.

Since this PR opened (2023), the core need it addressed — installing a JDK without making it the environment default — is being solved by the newer, focused PR #1017, which adds a single set-default input. set-default: false is the clean equivalent of this PR's update-env-javahome: false + update-env-path: false (and, like yours, it preserves JAVA_HOME_<major>_<arch>). We've decided to make set-default the canonical primitive for that behavior rather than maintain two overlapping sets of inputs.

The one capability here that set-default does not cover is your toolchains-only use case (issue #552): register the JDK in toolchains.xml only, without touching JAVA_HOME/PATH/settings.xml. We've captured that as a narrowed, standalone issue — #1047 — explicitly scoped to build on top of set-default instead of re-deriving the env-skipping logic.

So this PR is superseded by #1017 (the env/default primitive) plus #1047 (the remaining toolchains-only gap). Closing in favor of those. Your input on #1047 would be very welcome if you'd like to carry the toolchains-only piece forward on the cleaner foundation. 🙏

mhoffrog reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brunoborges brunoborges closed this Jun 23, 2026
@mhoffrog mhoffrog mentioned this pull request Jul 13, 2026
feat: Add input option add-toolchain-only #1109
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Allow to add a toolchain only - without updating settings.xml, JAVA_HOME and PATH. Only toolchains.xml must be extended.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mhoffrog @v-priya-kinthali @brunoborges
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.