apache / apache/maven-toolchains-plugin
[MTOOLCHAINS-58] Auto-detected Azul Zulu OpenJDK 8 is not found when selecting version 8, 1.8 or 1.8.0
- Dominant language
- Java
- Stars
- 27
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
**[Nils Breunese](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=breun)** opened **[MTOOLCHAINS-58](https://issues.apache.org/jira/browse/MTOOLCHAINS-58?redirect=false)** and commented
I have [Azul Zulu OpenJDK 8](https://www.azul.com/downloads/?version=java-8-lts&package=jdk#zulu) installed, and it is indeed auto-discovered by `toolchains:display-discovered-jdk-toolchains`:
```
[INFO] - /opt/local/Library/Java/JavaVirtualMachines/openjdk8-zulu/Contents/Home
[INFO] provides:
[INFO] version: 1.8.0_432
[INFO] runtime.name: OpenJDK Runtime Environment
[INFO] runtime.version: 1.8.0_432-b06
[INFO] vendor: Azul Systems, Inc.
[INFO] lts: true
```
I then want Maven to use Java 1.8 to build this project by adding this:
```
org.apache.maven.plugins
maven-toolchains-plugin
3.2.0
select-jdk-toolchain
1.8
```
But then I get this error message:
```
org.apache.maven.plugin.MojoFailureException: Cannot find matching toolchain definitions for the following toolchain types:{version=1.8}
Define the required toolchains in your ~/.m2/toolchains.xml file.
```
I want to avoid developers having to maintain a `toolchains.xml`, and I've verified that this method does work for projects that use JDK 21 (also without a `toolchains.xml`, using auto-discovery).
I've also tried setting the version to `8` and `1.8.0`, but that also didn't work.
Setting the version to `1.8.0_432` does work, but I don't want to force other developers to have this exact Java 8 build installed.
---
**Affects:** 3.2.0
1 votes, 2 watchers
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.