Home > database >  Transitive dependency in a maven reactor with jdk17
Transitive dependency in a maven reactor with jdk17

Time:11-21

I am in the process of upgrading a large application to JDK17. Today, the project compile fine with a JDK11 and maven.

With JDK17, I have a really strange issue with versions of transitive dependencies.

This project is composed of multiple sub modules. If I compile a module directly, it works fine.

However, If I compile the root module, or any module containing submodules, the resolution of transitive dependencies doesn't work. I have error like the following :

[INFO] -------------------------------[ bundle ]-------------------------------

Downloading from internal-repository: http://srv:8080/nexus/content/groups/public/org/apache/camel/camel-netty4/$%7Bproject.version}/camel-netty4-$%7Bproject.version}.pom

[WARNING] The POM for org.apache.camel:camel-netty4:jar:${project.version} is missing, no dependency information available

Downloading from internal-repository: http://srv:8080/nexus/content/groups/public/org/apache/camel/camel-netty4/$%7Bproject.version}/camel-netty4-$%7Bproject.version}.jar

The version of the dependency is ${project.version} instead of the real version. The project doesn't use camel-netty4 directly but camel-syslog :

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-syslog</artifactId>
  <version>${camel.version}</version>
</dependency>

this just an example, others projects fails with other transitive dependencies. And it works if I compile the sub-module directly.

Maven 3.6.3

CodePudding user response:

I was using "Eclipse Adoptium - Temurin-17 35" By switching to an official OpenJDK, I can't reproduce this issue.

This JDK doesn't work in my case, with random errors about interpolation issue

IMPLEMENTOR="Eclipse Adoptium"
IMPLEMENTOR_VERSION="Temurin-17 35"
JAVA_VERSION="17"
JAVA_VERSION_DATE="2021-09-14"
FULL_VERSION="17 35"
SEMANTIC_VERSION="17 35"
BUILD_INFO="OS: Windows Server 2012 R2 Version: 6.3"
JVM_VARIANT="Hotspot"
JVM_VERSION="17 35"
IMAGE_TYPE="JDK"

This one worked every times:

IMPLEMENTOR="Oracle Corporation"
JAVA_VERSION="17.0.1"
JAVA_VERSION_DATE="2021-10-19"
LIBC="default"
MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.incubator.foreign jdk.incubator.vector jdk.internal.le jdk.internal.opt jdk.internal.vm.ci jdk.internal.vm.compiler jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.random jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom jdk.zipfs"
OS_ARCH="x86_64"
OS_NAME="Windows"
SOURCE=".:git:75240a5872a1"
  • Related