Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle: Support installation of JDK version requested by Gradle Daemon JVM Discovery #30165

Closed
rarkinsopened this issue Jul 13, 2024 Discussed in #30164 · 3 comments · Fixed by#31319
Closed

Gradle: Support installation of JDK version requested by Gradle Daemon JVM Discovery #30165

rarkinsopened this issue Jul 13, 2024 Discussed in #30164 · 3 comments · Fixed by#31319
Labels
manager:gradle Gradle package manager manager:gradle-wrapper priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jul 13, 2024

Discussed in#30164

Originally posted bydavidburstromJuly 13, 2024

What would you like help with?

Other

How are you running Renovate?

Mend Renovate hosted app on github

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

No response

Please tell us more about your question or problem

The JDK that gets installed in order to run Gradle is resolved by Renovate based on the Gradle version in use(source).There is a new Gradle feature,Daemon JVM discovery,that dictates which (installed) JDK the daemon should be launched with.

By inspecting thegradle/gradle-daemon-jvm.propertiesfile (if present), Renovate can resolve which JDK version it should install.

The reason I discovered this was because the job to update the Gradle wrapper (davidburstrom/contester#111) failed to run./gradlew:wrapper,and while investigating the job logs, I found that it installed JDK 17 whereas Gradle requested JDK 21.

JDK selection is necessary to support cases where any applied Gradle plugins require a more modern JDK than Gradle itself requires.

Logs (if relevant)

Logs
DEBUG: Using containerbase dynamic installs (branch= "renovate/gradle-8.x" )
DEBUG: Resolved stable matching version (branch= "renovate/gradle-8.x" )
{
"toolName": "java"
"constraint": "^17.0.0"
"resolvedVersion": "17.0.11+9"
}

DEBUG: Executing command (branch= "renovate/gradle-8.x" )
{
"command": "install-tool java 17.0.11+9"
}

DEBUG: exec completed (branch= "renovate/gradle-8.x" )
{
"durationMs": 8002
"stdout": "[10:50:18.078] INFO (62): Installing tool [email protected]+9...\nopenjdk version \" 17.0.11\ "2024-04-16\nOpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)\nOpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, sharing)\n[10:50:25.190] INFO (62): Installed tool java in 7.1s.\n"
"stderr": ""
}

DEBUG: Executing command (branch= "renovate/gradle-8.x" )
{
"command": "./gradlew:wrapper --gradle-distribution-url https://services.gradle.org/distributions/gradle-8.9-bin.zip --gradle-distribution-sha256-sum d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab"
}

DEBUG: rawExec err (branch= "renovate/gradle-8.x" )
{
"err": {
"cmd": "/bin/sh -c./gradlew:wrapper --gradle-distribution-url https://services.gradle.org/distributions/gradle-8.9-bin.zip --gradle-distribution-sha256-sum d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab",
"stderr": "\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nCannot find a Java installation on your machine (Linux 5.15.0-1058-aws amd64) matching the Daemon JVM defined requirements: Compatible with Java 21 (from gradle/gradle-daemon-jvm.properties).\n\n* Try:\n> Run with --stacktrace option to get the stack trace.\n> Run with --info or --debug option to get more log output.\n> Run with --scan to get full insights.\n> Get more help at https://help.gradle.org.\n",```

</details>
</div>
@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:gradle Gradle package manager manager:gradle-wrapper labels Jul 13, 2024
@marcphilipp
Copy link
Contributor

I'm also seeing this problem for thehttps://github /junit-team/junit5repo. Would a PR be welcome to resolve this?

@Churro
Copy link
Collaborator

Churro commented Sep 10, 2024

@marcphilipp,Hope you don't mind that I went ahead with the PR. I already had this ready in July but forgot about submitting it due to vacation.

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 38.80.0 🎉

The release is available on:

Yoursemantic-releasebot 📦🚀

@github-actions github-actions bot locked asresolvedand limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gradle Gradle package manager manager:gradle-wrapper priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants