我正在将一个大型应用程序升级到 JDK17。今天,该项目使用 JDK11 和 maven 编译良好。
使用 JDK17,我对传递依赖的版本有一个非常奇怪的问题。
本项目由多个子模块组成。如果我直接编译一个模块,它工作正常。
但是,如果我编译根模块或任何包含子模块的模块,传递依赖的解析不起作用。我有如下错误:
[INFO] -------------------------------[ bundle ]-------------------------------
Downloading from internal-repository: http://srv:8080/nexus/content/groups/public/org/apache/camel/camel-netty4/$%7Bproject.version%7D/camel-netty4-$%7Bproject.version%7D.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%7D/camel-netty4-$%7Bproject.version%7D.jar
依赖的版本${project.version}
不是真实的版本。该项目不camel-netty4
直接使用,但是camel-syslog
:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-syslog</artifactId>
<version>${camel.version}</version>
</dependency>
这只是一个例子,其他项目因其他传递依赖而失败。如果我直接编译子模块,它就可以工作。
Maven 3.6.3