Ryan Skraba created AVRO-4207:
---------------------------------

             Summary: [build][Java]  Building the Java SDK with a single JDK 
version
                 Key: AVRO-4207
                 URL: https://issues.apache.org/jira/browse/AVRO-4207
             Project: Apache Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.13.0
            Reporter: Ryan Skraba


It seems to me that I _should_ be able to build the Java artifacts with only 
one SDK installed:

For example, this container is constrained to Java 11 (at time of writing still 
supported...):

{code}
cd avro/
docker run -it --rm -v $PWD:/opt/avro -w /opt/avro -v 
/etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u 1000:1000 -v 
/tmp/.m2:/opt/avro-cache/.m2 -e MAVEN_CONFIG=/opt/avro-cache/.m2 
maven:3.9.11-eclipse-temurin-11-alpine mvn -Duser.home=/opt/avro-cache/ clean 
install
{code}

But it fails with:

{code}
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-toolchains-plugin:3.2.0:select-jdk-toolchain 
(Ensure ToolChain for JDK 17 is available) on project avro-toplevel: Cannot 
find matching toolchain definitions for the following toolchain 
types:{version=[17,18)}
[ERROR] Define the required toolchains in your ~/.m2/toolchains.xml file.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
{code}

Similar errors with maven:3.9.11-eclipse-temurin-17-alpine, and 
maven:3.9.11-eclipse-temurin-21-alpine.

We might need all the JDKs for testing, and perhaps for the release, but the 
average user should be able to build the Avro SDK with a single Java version.  
This can probably be accomplished through a maven profile.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to