Hi Debraj,

That's strange. "mvn dependency:tree -Dverbose" gives more information.

"mvn help:effective-pom" may give you some information for netty-comon.

By any change, does the parent (or poms imported by parent) declare
dependencyManagement for netty-common?


On Fri, May 22, 2020 at 9:31 AM Debraj Manna <subharaj.ma...@gmail.com>
wrote:

> Hi
>
> In my project I am observing that maven 3.6.3 is bringing the test
> transitive dependency as compile. My understanding is that transitive
> dependency coming from test scope should also have test scope. Can someone
> let me know is my understanding wrong?
>
> When I run "mvn dependency:tree" for my project it shows the following:
>
> [INFO] \-
> org.apache.bookkeeper:bookkeeper-common:test-jar:tests:4.10.0:test
> [INFO]    +-
> org.apache.bookkeeper.stats:bookkeeper-stats-api:jar:4.10.0:test
> [INFO]    +- org.apache.bookkeeper:cpu-affinity:jar:4.10.0:test
> *[INFO]    +- io.netty:netty-common:jar:4.1.32.Final:compile*
> [INFO]    +- org.jctools:jctools-core:jar:2.1.2:test
> [INFO]    +- org.slf4j:slf4j-api:jar:1.7.25:compile
> [INFO]    \- commons-configuration:commons-configuration:jar:1.10:compile
>
> bookkeeper-common is in test scope but still netty-common is showing up as
> compile dependency. I have placed the entire dependency tree output here
> <https://gist.github.com/debraj-manna/dc51aa33d318b41126fb366372997893>.
>
> The pom is like below
>
>     <parent>
>         <groupId>com.vnera</groupId>
>         <artifactId>main</artifactId>
>         <version>0.001-SNAPSHOT</version>
>     </parent>
>
>     <artifactId>delete</artifactId>
>     <packaging>jar</packaging>
>     <name>delete</name>
>
>     <dependencies>
>         <dependency>
>             <groupId>com.vnera</groupId>
>             <artifactId>programs</artifactId>
>             <version>${main.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>com.vnera</groupId>
>             <artifactId>programs</artifactId>
>             <version>${main.version}</version>
>             <classifier>tests</classifier>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>com.vnera</groupId>
>             <artifactId>core-model</artifactId>
>             <version>${main.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>com.vnera</groupId>
>             <artifactId>storage-utils</artifactId>
>             <version>${main.version}</version>
>             <type>test-jar</type>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>com.github.rholder</groupId>
>             <artifactId>guava-retrying</artifactId>
>             <version>1.0.5</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>com.google.guava</groupId>
>                     <artifactId>guava</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </dependencies>
> </project>
>
>
> bookkeeper-common is defined in the parent pom as below
>
> <dependency>
>     <groupId>org.apache.bookkeeper</groupId>
>     <artifactId>bookkeeper-common</artifactId>
>     <version>4.10.0</version>
>     <type>test-jar</type>
>     <scope>test</scope>
> </dependency>
>


-- 
Regards,
Tomo

Reply via email to