You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephanie Wang (Jira)" <ji...@apache.org> on 2021/04/30 16:27:00 UTC

[jira] [Commented] (MDEP-737) dependency:list sets compile scope deps as test scope

    [ https://issues.apache.org/jira/browse/MDEP-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17337492#comment-17337492 ] 

Stephanie Wang commented on MDEP-737:
-------------------------------------

This is happening again in google-cloud-bigquery where commons-codec is set to be test scope although it is also used as compile scope:

Dependency tree (`mvn dependency:tree -Dincludes=commons-codec -Dverbose`)

[INFO] com.google.cloud:google-cloud-bigquery:jar:1.128.2-SNAPSHOT
[INFO] +- com.google.cloud:google-cloud-datacatalog:jar:1.3.2:test
[INFO] | \- (*{color:#00875a}commons-codec:commons-codec:jar:1.15:compile{color}* - version managed from 1.11; scope updated from test; omitted for duplicate)
[INFO] \- com.google.http-client:google-http-client:jar:1.39.2:compile
[INFO] \- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] \- commons-codec:commons-codec:jar:1.15:compile (version managed from 1.11)

 

`mvn dependency:list -f pom.xml`

[INFO] commons-codec:commons-codec:jar:1.15:*{color:#de350b}test{color}*

The expected should be:

[INFO] commons-codec:commons-codec:jar:1.15:*compile*

*Putting in a temp fix for now: https://github.com/googleapis/java-bigquery/pull/1266/files#diff-567d21712b8e585cfcb63e34de4bf9e8aa76df9c564ae6caa769051752898cd6R54*

> dependency:list sets compile scope deps as test scope
> -----------------------------------------------------
>
>                 Key: MDEP-737
>                 URL: https://issues.apache.org/jira/browse/MDEP-737
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>            Reporter: Stephanie Wang
>            Priority: Major
>
> Observing this in some googleapis client libraries (relates to: [https://github.com/googleapis/java-scheduler/pull/366)]
> In [https://github.com/googleapis/java-scheduler] repo,
> `mvn dependency:tree -Dverbose -Dincludes=commons-codec` outputs:
> [INFO] com.google.cloud:google-cloud-scheduler:jar:1.23.8-SNAPSHOT
> [INFO] +- com.google.api:gax:jar:1.62.0:compile
> [INFO] | \- com.google.auth:google-auth-library-oauth2-http:jar:0.24.0:compile
> [INFO] | \- com.google.http-client:google-http-client:jar:1.39.0:compile (version managed from 1.38.1)
> [INFO] | \- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
> {color:#00875a}*[INFO] | \- commons-codec:commons-codec:jar:1.15:compile (version managed from 1.11)*{color}
> [INFO] \- com.google.cloud:google-cloud-pubsub:jar:1.111.4:test
> [INFO] \- (commons-codec:commons-codec:jar:1.15:compile - version managed from 1.11; scope updated from test; omitted for duplicate)
>  
> `mvn dependency:list -f pom.xml` outputs:
> [INFO] commons-codec:commons-codec:jar:1.15:{color:#FF0000}*test*{color}
> However, we are expecting:
> [INFO] commons-codec:commons-codec:jar:1.15:{color:#172b4d}*compile*{color}
> Since this commons-code is both a compile-scope transitive dependency and a test-scope transitive dependency. Why is it automatically resolved to test-scope?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)