You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2021/05/20 18:18:00 UTC

[jira] [Updated] (MDEP-749) copy-dependencies fails when using excludeScopes=test

     [ https://issues.apache.org/jira/browse/MDEP-749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MDEP-749:
-------------------------------
    Summary: copy-dependencies fails when using excludeScopes=test  (was: copy-dependencies fails when using excludeScopes if result is empty)

> copy-dependencies fails when using excludeScopes=test
> -----------------------------------------------------
>
>                 Key: MDEP-749
>                 URL: https://issues.apache.org/jira/browse/MDEP-749
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: copy-dependencies
>    Affects Versions: 3.1.2
>            Reporter: Herve Boutemy
>            Priority: Major
>             Fix For: 3.2.0
>
>
> {{mvn dependency:copy-dependencies}} works well even if a POM does not have any dependencies
> but {{mvn dependency:copy-dependencies -DexcludeScope=test}} fails if the result is empty (either because it was empty without the exclusion, or because the exclusion removed every existing dependency, like in this case if junit was a test scoped dependency)
> {noformat}$ mvn dependency:copy-dependencies -DexcludeScope=test
> [INFO] Scanning for projects...
> [INFO] 
> [INFO] --------------------< com.sonatype:dep-scope-test >---------------------
> [INFO] Building dep-scope-test 1.0-SNAPSHOT
> [INFO] --------------------------------[ jar ]---------------------------------
> [INFO] 
> [INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default-cli) @ dep-scope-test ---
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time:  0.765 s
> [INFO] Finished at: 2021-05-20T08:21:16+02:00
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencies (default-cli) on project dep-scope-test:  Can't exclude Test scope, this will exclude everything. -> [Help 1]
> [ERROR] 
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] 
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {noformat}
> can be done easily on a project created with {{mvn archetype:generate -DgroupId=com.sonatype -DartifactId=dep-scope-test -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false}}



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