Closed lhauspie closed 1 year ago
Can't reproduce for now .. Let's meet tomorrow to check that (with the new version I'll release today)
hmmmm 🤔 pretty wierd.
It works by running in docker maven:3.8.6-openjdk-11-slim
I'll deep dive this tonight (I can't meet tomorrow cause I'm in vacation).
I compared the logs in case of failure and in case of success and success logs display these lines in addition:
[INFO] --- aadarchi-maven-plugin:0.1.6:generate-model (default) @ example ---
[INFO] Adding dependency /root/.m2/repository/org/twdata/maven/mojo-executor/2.4.0/mojo-executor-2.4.0.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.6.4/maven-plugin-annotations-3.6.4.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/org/apache/maven/maven-plugin-api/3.8.6/maven-plugin-api-3.8.6.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/io/github/Riduidel/aadarchi/cdi-in-maven-plugin-helper/0.1.6/cdi-in-maven-plugin-helper-0.1.6.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/io/github/Riduidel/aadarchi/base/0.1.6/base-0.1.6.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/io/github/Riduidel/aadarchi/maven-metadata-inferer/0.1.6/maven-metadata-inferer-0.1.6.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/net/alchim31/livereload-jvm/0.2.0/livereload-jvm-0.2.0.jar to CLASSPATH
[INFO] Adding dependency /root/.m2/repository/org/apache/commons/commons-vfs2/2.9.0/commons-vfs2-2.9.0.jar to CLASSPATH
These lines are not present in case of failure. I don't know if it can explain something.
I tried with Java 8 but java 11 is the minimum version (Detected JDK Version: 1.8.0-302 is not in the allowed range 11.
)
I tried with Java 17 but it seems an issue already exists for that (https://github.com/Riduidel/aadarchi/issues/90)
I tried with an empty local maven repository, but same result.
For context, I use asdfvm to manage java versions on my laptop. Do you think the problem can come from this tool ?
Could you copy/paste here the result of your mvn -v
command please ?
It seems to come from class loader that loads jar in a certain order.
In case of failure, this dependency is loaded first:
[ERROR] urls[3] = file:/Users/lhauspie/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
instead of:
[ERROR] urls[3] = file:/root/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.6.4/maven-plugin-annotations-3.6.4.jar
Seems like it may be related to javax annotation api as used by maven plugin api
I think this issue has to be re-open @Riduidel because I still have a problem with the release 0.1.9 :
[ERROR] Failed to execute goal io.github.Riduidel.aadarchi:aadarchi-maven-plugin:0.1.9:generate-model (default) on project example3: Execution default of goal io.github.Riduidel.aadarchi:aadarchi-maven-plugin:0.1.9:generate-model failed: An API incompatibility was encountered while executing io.github.Riduidel.aadarchi:aadarchi-maven-plugin:0.1.9:generate-model: java.lang.IncompatibleClassChangeError: javax.enterprise.inject.Default and javax.enterprise.inject.Default$Literal disagree on InnerClasses attribute
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.github.Riduidel.aadarchi:aadarchi-maven-plugin:0.1.9
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/lhauspie/.m2/repository/io/github/Riduidel/aadarchi/aadarchi-maven-plugin/0.1.9/aadarchi-maven-plugin-0.1.9.jar
[ERROR] urls[1] = file:/Users/lhauspie/.m2/repository/org/twdata/maven/mojo-executor/2.4.0/mojo-executor-2.4.0.jar
[ERROR] urls[2] = file:/Users/lhauspie/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[3] = file:/Users/lhauspie/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
[ERROR] urls[4] = file:/Users/lhauspie/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5.jar
[ERROR] urls[5] = file:/Users/lhauspie/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
The javax.annotation-api-1.2.jar
still loaded in priority instead of maven-plugin-annotations-3.6.4.jar
@Riduidel could you copy/paste the result of mvn -v
command from your machine please ?
I will install the exact same version than you to try on my side.
Ok, my suspicions are correct... the problem is related to the version of maven.
Maven 3.8.1 et 3.8.2 has the same problem, but since 3.8.3 the problem is not present anymore. So the solution is to have maven in version 3.8.3+.
Maybe it could appear in the documentation as a pre-requisite to avoid others users to search for hours or even days 😉
Initiate the project with:
Then just build:
The interesting part of the log seems to be (Complete log bellow):
It seems
jakarta.enterprise:jakarta.enterprise.cdi-api:jar:2.0.2
is conflicting withjavax.enterprise:cdi-api:jar:2.0.SP1
but not really sure.Thanks for your support.
Detailed logs: