Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Action adds org.gradle.java.installations.fromEnv property which overrides project level setting #1024

Closed
bigdaz opened this issue Jan 2, 2024 · 0 comments
Milestone

Comments

@bigdaz
Copy link
Member

bigdaz commented Jan 2, 2024

In order to detect built-in JDK installations, the gradle-build-action adds the property org.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64 to ~/.gradle/gradle.properties.

However, if a project specifies org.gradle.java.installations.fromEnv=XXX in a project-level gradle.properties file, then this setting is overridden by the value set by the action in ~/.gradle/gradle.properties.

@bigdaz bigdaz added this to the 3.0.0 milestone Jan 4, 2024
bigdaz added a commit that referenced this issue Jan 4, 2024
Since adding these to the `org.gradle.java.installations.fromEnv` property
is problematic (#1024), this mechanism allows the default toolchains to
be discovered by Gradle via a different mechanism.

The default JDK installations are added to `~/.m2/toolchains.xml` such that
they are discoverable by Gradle toolchain support.
The `setup-java` action also writes to this file, so we merge with any existing
content: this allows both pre-installed and "setup" JDKs to be automatically
detected by Gradle.
@bigdaz bigdaz closed this as completed in 7c57ba1 Jan 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant