Maven brings “test” transitive dependency as “compile”

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven brings “test” transitive dependency as “compile”

Debraj Manna
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>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Tomo Suzuki
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 <[hidden email]>
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 | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Debraj Manna
Thanks Tomo for replying.

No I don't have any dependencyManagement specified in my parent pom. I have
placed the effective pom here
<https://gist.github.com/debraj-manna/c1b0debf3f50f5ede32d2e9de68430ac>.

mvn dependency:tree -Dverbose does not work for me. Below is the result I
got.

Am I hitting some known issue in maven ?

dmanna-a01:delete dmanna$ mvn dependency:tree -Dverbose
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO]
------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.15
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 15
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] --------------------------< com.vnera:delete
>--------------------------
[INFO] Building delete 0.001-SNAPSHOT
[INFO] --------------------------------[ jar
]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
*[INFO] Verbose not supported since maven-dependency-plugin 3.0*
[INFO] com.vnera:delete:jar:0.001-SNAPSHOT

On Fri, May 22, 2020 at 7:09 PM Tomo Suzuki <[hidden email]>
wrote:

> 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 <[hidden email]>
> 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 | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Andy Feldman
In reply to this post by Debraj Manna
On Fri, May 22, 2020 at 6:31 AM Debraj Manna <[hidden email]>
wrote:

> bookkeeper-common is in test scope but still netty-common is showing up as
> compile dependency.
>

Is it possible that netty-common is a transitive dependency of another
dependency as well? Running dependency:tree does not show all paths to each
dependency.

You can try running dependency:tree with the verbose flag to see more
branches of the tree, although the documentation says it is not guaranteed
to work properly with Maven 3.
https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose

You can also try removing the dependency on bookkeeper-common and running
dependency:tree again to see if netty-common still shows up.

--
Andy Feldman
Wealthfront
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Debraj Manna
Thanks Andy for replying.

maven dependency:tree -Dverbose does not seem to work for me. It gives me
the below message

...
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
[INFO] Verbose not supported since maven-dependency-plugin 3.0
[INFO] com.vnera:delete:jar:0.001-SNAPSHOT
...

If I just exclude netty-common from apache-bookkeeper then netty-common
4.1.32 does not show up in the dependency tree.


On Sat, May 23, 2020 at 3:57 AM Andy Feldman <[hidden email]> wrote:

> On Fri, May 22, 2020 at 6:31 AM Debraj Manna <[hidden email]>
> wrote:
>
> > bookkeeper-common is in test scope but still netty-common is showing up
> as
> > compile dependency.
> >
>
> Is it possible that netty-common is a transitive dependency of another
> dependency as well? Running dependency:tree does not show all paths to each
> dependency.
>
> You can try running dependency:tree with the verbose flag to see more
> branches of the tree, although the documentation says it is not guaranteed
> to work properly with Maven 3.
>
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
>
> You can also try removing the dependency on bookkeeper-common and running
> dependency:tree again to see if netty-common still shows up.
>
> --
> Andy Feldman
> Wealthfront
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Tomo Suzuki
Debraj,

I couldn't reproduce the problem in my setting. Netty-common appears as
test scope.
https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494

Would you be willing to create a minimum reproducible project?
Hopefully it builds only artifacts available on the public Internet (no
artifactory.arkin.local:8000).

BTW, this is the documentation I think your Maven tree is not behaving as
documented:
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope




On Sat, May 23, 2020 at 12:40 AM Debraj Manna <[hidden email]>
wrote:

> Thanks Andy for replying.
>
> maven dependency:tree -Dverbose does not seem to work for me. It gives me
> the below message
>
> ...
> [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
> [INFO] Verbose not supported since maven-dependency-plugin 3.0
> [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> ...
>
> If I just exclude netty-common from apache-bookkeeper then netty-common
> 4.1.32 does not show up in the dependency tree.
>
>
> On Sat, May 23, 2020 at 3:57 AM Andy Feldman <[hidden email]>
> wrote:
>
> > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <[hidden email]>
> > wrote:
> >
> > > bookkeeper-common is in test scope but still netty-common is showing up
> > as
> > > compile dependency.
> > >
> >
> > Is it possible that netty-common is a transitive dependency of another
> > dependency as well? Running dependency:tree does not show all paths to
> each
> > dependency.
> >
> > You can try running dependency:tree with the verbose flag to see more
> > branches of the tree, although the documentation says it is not
> guaranteed
> > to work properly with Maven 3.
> >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> >
> > You can also try removing the dependency on bookkeeper-common and running
> > dependency:tree again to see if netty-common still shows up.
> >
> > --
> > Andy Feldman
> > Wealthfront
> >
>


--
Regards,
Tomo
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Debraj Manna
Yes I saw the documentation. It is not behaving as expected.

Can you let me know what is the alternative for maven dependency:tree
-Dverbose  ? If I get the verbose mode for dependency:tree then I think
that will provide us more information.

On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki <[hidden email]>
wrote:

> Debraj,
>
> I couldn't reproduce the problem in my setting. Netty-common appears as
> test scope.
> https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
>
> Would you be willing to create a minimum reproducible project?
> Hopefully it builds only artifacts available on the public Internet (no
> artifactory.arkin.local:8000).
>
> BTW, this is the documentation I think your Maven tree is not behaving as
> documented:
>
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
>
>
>
>
> On Sat, May 23, 2020 at 12:40 AM Debraj Manna <[hidden email]>
> wrote:
>
> > Thanks Andy for replying.
> >
> > maven dependency:tree -Dverbose does not seem to work for me. It gives me
> > the below message
> >
> > ...
> > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
> > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > ...
> >
> > If I just exclude netty-common from apache-bookkeeper then netty-common
> > 4.1.32 does not show up in the dependency tree.
> >
> >
> > On Sat, May 23, 2020 at 3:57 AM Andy Feldman <[hidden email]>
> > wrote:
> >
> > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <[hidden email]
> >
> > > wrote:
> > >
> > > > bookkeeper-common is in test scope but still netty-common is showing
> up
> > > as
> > > > compile dependency.
> > > >
> > >
> > > Is it possible that netty-common is a transitive dependency of another
> > > dependency as well? Running dependency:tree does not show all paths to
> > each
> > > dependency.
> > >
> > > You can try running dependency:tree with the verbose flag to see more
> > > branches of the tree, although the documentation says it is not
> > guaranteed
> > > to work properly with Maven 3.
> > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > >
> > > You can also try removing the dependency on bookkeeper-common and
> running
> > > dependency:tree again to see if netty-common still shows up.
> > >
> > > --
> > > Andy Feldman
> > > Wealthfront
> > >
> >
>
>
> --
> Regards,
> Tomo
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Nick_S
The verbose flag was removed in newer versions of the plugin. You could try
an old pluginversion:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose

With regards,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Sat, May 23, 2020 at 7:53 PM Debraj Manna <[hidden email]>
wrote:

> Yes I saw the documentation. It is not behaving as expected.
>
> Can you let me know what is the alternative for maven dependency:tree
> -Dverbose  ? If I get the verbose mode for dependency:tree then I think
> that will provide us more information.
>
> On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki <[hidden email]>
> wrote:
>
> > Debraj,
> >
> > I couldn't reproduce the problem in my setting. Netty-common appears as
> > test scope.
> > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> >
> > Would you be willing to create a minimum reproducible project?
> > Hopefully it builds only artifacts available on the public Internet (no
> > artifactory.arkin.local:8000).
> >
> > BTW, this is the documentation I think your Maven tree is not behaving as
> > documented:
> >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> >
> >
> >
> >
> > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <[hidden email]>
> > wrote:
> >
> > > Thanks Andy for replying.
> > >
> > > maven dependency:tree -Dverbose does not seem to work for me. It gives
> me
> > > the below message
> > >
> > > ...
> > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete
> ---
> > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > > ...
> > >
> > > If I just exclude netty-common from apache-bookkeeper then netty-common
> > > 4.1.32 does not show up in the dependency tree.
> > >
> > >
> > > On Sat, May 23, 2020 at 3:57 AM Andy Feldman <[hidden email]>
> > > wrote:
> > >
> > > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <
> [hidden email]
> > >
> > > > wrote:
> > > >
> > > > > bookkeeper-common is in test scope but still netty-common is
> showing
> > up
> > > > as
> > > > > compile dependency.
> > > > >
> > > >
> > > > Is it possible that netty-common is a transitive dependency of
> another
> > > > dependency as well? Running dependency:tree does not show all paths
> to
> > > each
> > > > dependency.
> > > >
> > > > You can try running dependency:tree with the verbose flag to see more
> > > > branches of the tree, although the documentation says it is not
> > > guaranteed
> > > > to work properly with Maven 3.
> > > >
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > > >
> > > > You can also try removing the dependency on bookkeeper-common and
> > running
> > > > dependency:tree again to see if netty-common still shows up.
> > > >
> > > > --
> > > > Andy Feldman
> > > > Wealthfront
> > > >
> > >
> >
> >
> > --
> > Regards,
> > Tomo
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Debraj Manna
You can reproduce the issue in
https://github.com/debraj-manna/dependency-issue

In dependency tree of delete I am seeing dependency as below

[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]    +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
[INFO]    +-
com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
[INFO]    +- org.jctools:jctools-core:jar:2.1.2:test
[INFO]    +- org.slf4j:slf4j-api:jar:1.7.25:test
[INFO]    \- commons-configuration:commons-configuration:jar:1.10:test


On Sun, May 24, 2020 at 2:47 AM Nick Stolwijk <[hidden email]>
wrote:

> The verbose flag was removed in newer versions of the plugin. You could try
> an old pluginversion:
>
> mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose
>
> With regards,
>
> Nick Stolwijk
>
> ~~~ Try to leave this world a little better than you found it and, when
> your turn comes to die, you can die happy in feeling that at any rate you
> have not wasted your time but have done your best ~~~
>
> Lord Baden-Powell
>
>
> On Sat, May 23, 2020 at 7:53 PM Debraj Manna <[hidden email]>
> wrote:
>
> > Yes I saw the documentation. It is not behaving as expected.
> >
> > Can you let me know what is the alternative for maven dependency:tree
> > -Dverbose  ? If I get the verbose mode for dependency:tree then I think
> > that will provide us more information.
> >
> > On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki <[hidden email]>
> > wrote:
> >
> > > Debraj,
> > >
> > > I couldn't reproduce the problem in my setting. Netty-common appears as
> > > test scope.
> > > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> > >
> > > Would you be willing to create a minimum reproducible project?
> > > Hopefully it builds only artifacts available on the public Internet (no
> > > artifactory.arkin.local:8000).
> > >
> > > BTW, this is the documentation I think your Maven tree is not behaving
> as
> > > documented:
> > >
> > >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> > >
> > >
> > >
> > >
> > > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <
> [hidden email]>
> > > wrote:
> > >
> > > > Thanks Andy for replying.
> > > >
> > > > maven dependency:tree -Dverbose does not seem to work for me. It
> gives
> > me
> > > > the below message
> > > >
> > > > ...
> > > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete
> > ---
> > > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > > > ...
> > > >
> > > > If I just exclude netty-common from apache-bookkeeper then
> netty-common
> > > > 4.1.32 does not show up in the dependency tree.
> > > >
> > > >
> > > > On Sat, May 23, 2020 at 3:57 AM Andy Feldman <[hidden email]>
> > > > wrote:
> > > >
> > > > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <
> > [hidden email]
> > > >
> > > > > wrote:
> > > > >
> > > > > > bookkeeper-common is in test scope but still netty-common is
> > showing
> > > up
> > > > > as
> > > > > > compile dependency.
> > > > > >
> > > > >
> > > > > Is it possible that netty-common is a transitive dependency of
> > another
> > > > > dependency as well? Running dependency:tree does not show all paths
> > to
> > > > each
> > > > > dependency.
> > > > >
> > > > > You can try running dependency:tree with the verbose flag to see
> more
> > > > > branches of the tree, although the documentation says it is not
> > > > guaranteed
> > > > > to work properly with Maven 3.
> > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > > > >
> > > > > You can also try removing the dependency on bookkeeper-common and
> > > running
> > > > > dependency:tree again to see if netty-common still shows up.
> > > > >
> > > > > --
> > > > > Andy Feldman
> > > > > Wealthfront
> > > > >
> > > >
> > >
> > >
> > > --
> > > Regards,
> > > Tomo
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Andy Feldman
Thanks for an easy public reproduction!

netty-common is coming through with compile scope from:
org.elasticsearch.client:transport:jar:5.6.16:compile
 -> org.elasticsearch.plugin:transport-netty4-client:jar:5.6.16:compile
 ---> io.netty:netty-common:jar:4.1.13.Final:compile

I found this by excluding the netty-common dependency
from bookkeeper-common and running dependency:tree again, which actually
you said you did as well, so I'm curious what we did differently.

Anyway, I hope this helps!
--
Andy Feldman
Wealthfront



On Tue, May 26, 2020 at 11:59 AM Debraj Manna <[hidden email]>
wrote:

> You can reproduce the issue in
> https://github.com/debraj-manna/dependency-issue
>
> In dependency tree of delete I am seeing dependency as below
>
> [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]    +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
> [INFO]    +-
> com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
> [INFO]    +- org.jctools:jctools-core:jar:2.1.2:test
> [INFO]    +- org.slf4j:slf4j-api:jar:1.7.25:test
> [INFO]    \- commons-configuration:commons-configuration:jar:1.10:test
>
>
> On Sun, May 24, 2020 at 2:47 AM Nick Stolwijk <[hidden email]>
> wrote:
>
> > The verbose flag was removed in newer versions of the plugin. You could
> try
> > an old pluginversion:
> >
> > mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose
> >
> > With regards,
> >
> > Nick Stolwijk
> >
> > ~~~ Try to leave this world a little better than you found it and, when
> > your turn comes to die, you can die happy in feeling that at any rate you
> > have not wasted your time but have done your best ~~~
> >
> > Lord Baden-Powell
> >
> >
> > On Sat, May 23, 2020 at 7:53 PM Debraj Manna <[hidden email]>
> > wrote:
> >
> > > Yes I saw the documentation. It is not behaving as expected.
> > >
> > > Can you let me know what is the alternative for maven dependency:tree
> > > -Dverbose  ? If I get the verbose mode for dependency:tree then I think
> > > that will provide us more information.
> > >
> > > On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki <[hidden email]
> >
> > > wrote:
> > >
> > > > Debraj,
> > > >
> > > > I couldn't reproduce the problem in my setting. Netty-common appears
> as
> > > > test scope.
> > > > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> > > >
> > > > Would you be willing to create a minimum reproducible project?
> > > > Hopefully it builds only artifacts available on the public Internet
> (no
> > > > artifactory.arkin.local:8000).
> > > >
> > > > BTW, this is the documentation I think your Maven tree is not
> behaving
> > as
> > > > documented:
> > > >
> > > >
> > >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> > > >
> > > >
> > > >
> > > >
> > > > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <
> > [hidden email]>
> > > > wrote:
> > > >
> > > > > Thanks Andy for replying.
> > > > >
> > > > > maven dependency:tree -Dverbose does not seem to work for me. It
> > gives
> > > me
> > > > > the below message
> > > > >
> > > > > ...
> > > > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @
> delete
> > > ---
> > > > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > > > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > > > > ...
> > > > >
> > > > > If I just exclude netty-common from apache-bookkeeper then
> > netty-common
> > > > > 4.1.32 does not show up in the dependency tree.
> > > > >
> > > > >
> > > > > On Sat, May 23, 2020 at 3:57 AM Andy Feldman <
> [hidden email]>
> > > > > wrote:
> > > > >
> > > > > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <
> > > [hidden email]
> > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > bookkeeper-common is in test scope but still netty-common is
> > > showing
> > > > up
> > > > > > as
> > > > > > > compile dependency.
> > > > > > >
> > > > > >
> > > > > > Is it possible that netty-common is a transitive dependency of
> > > another
> > > > > > dependency as well? Running dependency:tree does not show all
> paths
> > > to
> > > > > each
> > > > > > dependency.
> > > > > >
> > > > > > You can try running dependency:tree with the verbose flag to see
> > more
> > > > > > branches of the tree, although the documentation says it is not
> > > > > guaranteed
> > > > > > to work properly with Maven 3.
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > > > > >
> > > > > > You can also try removing the dependency on bookkeeper-common and
> > > > running
> > > > > > dependency:tree again to see if netty-common still shows up.
> > > > > >
> > > > > > --
> > > > > > Andy Feldman
> > > > > > Wealthfront
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Regards,
> > > > Tomo
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven brings “test” transitive dependency as “compile”

Debraj Manna
Thanks Andy.

It was a part of big multi-module project which I tried to extract out. So
I missed excluding it in some places.

On Wed, May 27, 2020 at 5:01 AM Andy Feldman <[hidden email]> wrote:

> Thanks for an easy public reproduction!
>
> netty-common is coming through with compile scope from:
> org.elasticsearch.client:transport:jar:5.6.16:compile
>  -> org.elasticsearch.plugin:transport-netty4-client:jar:5.6.16:compile
>  ---> io.netty:netty-common:jar:4.1.13.Final:compile
>
> I found this by excluding the netty-common dependency
> from bookkeeper-common and running dependency:tree again, which actually
> you said you did as well, so I'm curious what we did differently.
>
> Anyway, I hope this helps!
> --
> Andy Feldman
> Wealthfront
>
>
>
> On Tue, May 26, 2020 at 11:59 AM Debraj Manna <[hidden email]>
> wrote:
>
> > You can reproduce the issue in
> > https://github.com/debraj-manna/dependency-issue
> >
> > In dependency tree of delete I am seeing dependency as below
> >
> > [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]    +-
> com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
> > [INFO]    +-
> > com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
> > [INFO]    +- org.jctools:jctools-core:jar:2.1.2:test
> > [INFO]    +- org.slf4j:slf4j-api:jar:1.7.25:test
> > [INFO]    \- commons-configuration:commons-configuration:jar:1.10:test
> >
> >
> > On Sun, May 24, 2020 at 2:47 AM Nick Stolwijk <[hidden email]>
> > wrote:
> >
> > > The verbose flag was removed in newer versions of the plugin. You could
> > try
> > > an old pluginversion:
> > >
> > > mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree
> -Dverbose
> > >
> > > With regards,
> > >
> > > Nick Stolwijk
> > >
> > > ~~~ Try to leave this world a little better than you found it and, when
> > > your turn comes to die, you can die happy in feeling that at any rate
> you
> > > have not wasted your time but have done your best ~~~
> > >
> > > Lord Baden-Powell
> > >
> > >
> > > On Sat, May 23, 2020 at 7:53 PM Debraj Manna <[hidden email]
> >
> > > wrote:
> > >
> > > > Yes I saw the documentation. It is not behaving as expected.
> > > >
> > > > Can you let me know what is the alternative for maven dependency:tree
> > > > -Dverbose  ? If I get the verbose mode for dependency:tree then I
> think
> > > > that will provide us more information.
> > > >
> > > > On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki
> <[hidden email]
> > >
> > > > wrote:
> > > >
> > > > > Debraj,
> > > > >
> > > > > I couldn't reproduce the problem in my setting. Netty-common
> appears
> > as
> > > > > test scope.
> > > > > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> > > > >
> > > > > Would you be willing to create a minimum reproducible project?
> > > > > Hopefully it builds only artifacts available on the public Internet
> > (no
> > > > > artifactory.arkin.local:8000).
> > > > >
> > > > > BTW, this is the documentation I think your Maven tree is not
> > behaving
> > > as
> > > > > documented:
> > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <
> > > [hidden email]>
> > > > > wrote:
> > > > >
> > > > > > Thanks Andy for replying.
> > > > > >
> > > > > > maven dependency:tree -Dverbose does not seem to work for me. It
> > > gives
> > > > me
> > > > > > the below message
> > > > > >
> > > > > > ...
> > > > > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @
> > delete
> > > > ---
> > > > > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > > > > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > > > > > ...
> > > > > >
> > > > > > If I just exclude netty-common from apache-bookkeeper then
> > > netty-common
> > > > > > 4.1.32 does not show up in the dependency tree.
> > > > > >
> > > > > >
> > > > > > On Sat, May 23, 2020 at 3:57 AM Andy Feldman <
> > [hidden email]>
> > > > > > wrote:
> > > > > >
> > > > > > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <
> > > > [hidden email]
> > > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > bookkeeper-common is in test scope but still netty-common is
> > > > showing
> > > > > up
> > > > > > > as
> > > > > > > > compile dependency.
> > > > > > > >
> > > > > > >
> > > > > > > Is it possible that netty-common is a transitive dependency of
> > > > another
> > > > > > > dependency as well? Running dependency:tree does not show all
> > paths
> > > > to
> > > > > > each
> > > > > > > dependency.
> > > > > > >
> > > > > > > You can try running dependency:tree with the verbose flag to
> see
> > > more
> > > > > > > branches of the tree, although the documentation says it is not
> > > > > > guaranteed
> > > > > > > to work properly with Maven 3.
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > > > > > >
> > > > > > > You can also try removing the dependency on bookkeeper-common
> and
> > > > > running
> > > > > > > dependency:tree again to see if netty-common still shows up.
> > > > > > >
> > > > > > > --
> > > > > > > Andy Feldman
> > > > > > > Wealthfront
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Regards,
> > > > > Tomo
> > > > >
> > > >
> > >
> >
>