Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.9.6
-
None
-
None
Description
I discovered this situation when combining these dependencies:
<dependency> <groupId>org.hibernate.orm</groupId> <artifactId>hibernate-core</artifactId> <version>6.4.1.Final</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.github.openfeign.querydsl</groupId> <artifactId>querydsl-apt</artifactId> <classifier>jpa</classifier> <version>6.0.2</version> <scope>provided</scope> </dependency>
This results in two copies of a transient dependency on jakarta.inject:jakarta.inject-api, one with runtime scope and one with provided scope. In my case, Maven resolves this to a single dependency at runtime scope, which causes the build to fail.
Instead, the two scopes should logically combine into the compile scope. While this can be manually achieved with <dependencyManagement>, it would be nice if Maven did this automatically.