toolchains-maven-plugin icon indicating copy to clipboard operation
toolchains-maven-plugin copied to clipboard

Downloading JDK EA builds

Open cushon opened this issue 1 year ago • 0 comments

Is there a way to download early access JDK builds with the plugin?

E.g. looking at https://api.foojay.io/disco/v3.0/distributions there are several entries for early access builds of JDK 24 with versions like 24-ea+9, but there doesn't appear to be a way to download them.

Demo:

      <plugin>
        <groupId>org.mvnsearch</groupId>
        <artifactId>toolchains-maven-plugin</artifactId>
        <version>4.5.0</version>
        <executions>
            <execution>
              <id>download-24</id>
              <goals>
                <goal>toolchain</goal>
              </goals>
              <configuration>
                <toolchains>
                  <jdk>
                    <version>24</version>
                    <vendor>zulu</vendor>
                  </jdk>
                </toolchains>
              </configuration>
            </execution>
          </executions>
        </plugin>
$ mvn package
...
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at jdk.internal.util.Preconditions.outOfBounds (Preconditions.java:100)
    at jdk.internal.util.Preconditions.outOfBoundsCheckIndex (Preconditions.java:106)
    at jdk.internal.util.Preconditions.checkIndex (Preconditions.java:302)
    at java.util.Objects.checkIndex (Objects.java:385)
    at java.util.ArrayList.get (ArrayList.java:427)
    at com.google.gson.JsonArray.get (JsonArray.java:203)
    at org.apache.maven.plugins.toolchain.FoojayService.parseFileNameAndDownloadUrl (FoojayService.java:145)

This CLI also does not download EA versions:

$ ./mt.sh add 24 --vendor=zulu
JDK not found: 24

cushon avatar Aug 07 '24 23:08 cushon