Howdy, seems is "known issue" https://issues.apache.org/jira/browse/MNG-6224
what happens if you reorder your dependencies in pom, first compile and then test scoped ones? HTH T On Tue, Apr 12, 2022 at 1:00 PM Rimvydas Vaidelis < rimvydas.vaide...@gmail.com> wrote: > Hello, > > I have 2 dependencies org.reflections:reflections:jar:0.9.8:test and > com.google.inject:guice:jar:5.1.0:compile. > org.reflections:reflections:jar:0.9.8 uses > com.google.guava:guava:jar:11.0.2:compile > com.google.inject:guice:jar:5.1.0 uses > com.google.guava:guava:30.1-jre:compile > > During compiling of the module (mvn compile) the compile classpath contains > guava-11.0.2.jar. Why? It seems > that occurrence of version conflict changes the scope of the transitive > dependency com.google.guava:guava:jar:11.0.2 to compile. > Is this an expected behavior? > > Dependency tree: > > org.example:dependency-conflict-example:jar:1.0-SNAPSHOT > +- org.reflections:reflections:jar:0.9.8:test > | +- com.google.guava:guava:jar:11.0.2:compile > | | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile > | +- javassist:javassist:jar:3.12.1.GA:test > | \- dom4j:dom4j:jar:1.6.1:test > \- com.google.inject:guice:jar:5.1.0:compile > +- javax.inject:javax.inject:jar:1:compile > \- aopalliance:aopalliance:jar:1.0:compile > > pom.xml file: > > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > > <groupId>org.example</groupId> > <artifactId>dependency-conflict-example</artifactId> > <version>1.0-SNAPSHOT</version> > > <properties> > <maven.compiler.source>11</maven.compiler.source> > <maven.compiler.target>11</maven.compiler.target> > </properties> > > <dependencies> > <dependency> > <groupId>org.reflections</groupId> > <artifactId>reflections</artifactId> > <version>0.9.8</version> > <scope>test</scope> > </dependency> > <dependency> > <groupId>com.google.inject</groupId> > <artifactId>guice</artifactId> > <version>5.1.0</version> > </dependency> > </dependencies> > </project> > > -- > Rimvydas >