You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "efegokdemir (via GitHub)" <gi...@apache.org> on 2026/09/23 13:04:19 UTC

[PR] Ignore invalid JDKs during discovery [maven-toolchains-plugin]

efegokdemir opened a new pull request, #196:
URL: https://github.com/apache/maven-toolchains-plugin/pull/196

   ## Summary
   
   Fixes #191. JDK discovery currently dereferences a null model when an installed JDK cannot report `java.version`, causing discovery to discard valid JDKs as well.
   
   ## Changes
   
   - Skip invalid JDK candidates before applying flags and LTS detection.
   - Add a regression test using an executable fake JDK that does not report Java properties, while asserting the current JDK is still discovered.
   
   ## Testing
   
   - `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Dtest=ToolchainDiscovererTest test` — passed (2 tests).
   - `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Prun-its verify` — passed (8 integration tests).
   - `git diff --check` — passed.
   
   No overlapping open PR was found for issue #191 or invalid JDK discovery.
   
   AI assistance was used to investigate, implement, and test this change. The submitting human reviewed the complete diff and validation results.
   
   The submitting human acknowledges this contribution under the Apache License, Version 2.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Ignore invalid JDKs during discovery [maven-toolchains-plugin]

Posted by "efegokdemir (via GitHub)" <gi...@apache.org>.
efegokdemir commented on PR #196:
URL: https://github.com/apache/maven-toolchains-plugin/pull/196#issuecomment-5930259987

   Applied and pushed the requested JDK 8 guard in bc48313: testInvalidJdkDoesNotPreventDiscovery is now annotated with @DisabledOnJre(JRE.JAVA_8), matching testDiscovery because Java 8 may expose a JRE without bin/javac. The local environment has no Java/Maven, so I could not run the focused test here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Ignore invalid JDKs during discovery [maven-toolchains-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz merged PR #196:
URL: https://github.com/apache/maven-toolchains-plugin/pull/196


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org