reda-alaoui opened a new issue, #1821:
URL: https://github.com/apache/maven-dependency-plugin/issues/1821

   ### Need
   
   A common need is "every dependency except the test ones": the dependencies a 
released artifact actually carries, whatever their scope (compile, provided, 
system, runtime).
   
   `includeScope` and `excludeScope` cannot express it, because they are 
classpath thresholds, not declared scopes:
   
   | Setting | Gives | Misses |
   |---|---|---|
   | `includeScope=compile` | compile, provided, system | runtime |
   | `includeScope=runtime` | compile, runtime | provided, system |
   | `excludeScope=test` | fails: "Can't exclude Test scope, this will exclude 
everything." | |
   
   Only one of them can be set at a time, so no configuration yields the set in 
one execution. Today it takes two executions merged afterwards, or 
post-processing the output of `dependency:list` line by line on its scope field.
   
   ### History
   
   - #622 (MDEP-85) asked for exactly this and was closed as not planned; its 
comments ("I want all scopes but test and none of the given choices do what I 
want") show the demand.
   - #683 (MDEP-128) asked for several `includeScope` values; it was closed by 
documenting the threshold semantics.
   - #1263 (MDEP-749) documented why `excludeScope=test` has no meaning.
   
   The documentation is now clear, but the need is still unmet.
   
   ### Proposal
   
   Add a filter on the scope declared on each resolved dependency (as printed 
by `dependency:list`), independent from the classpath thresholds, to the goals 
that already take `includeScope`/`excludeScope` (`list`, `copy-dependencies`, 
`unpack-dependencies`, `resolve`, `build-classpath`, …):
   
   - `excludeDeclaredScopes`: a comma-separated list, e.g. 
`-DexcludeDeclaredScopes=test`
   - possibly its counterpart `includeDeclaredScopes`
   
   Applied after resolution, it keeps every dependency whose effective scope is 
not listed. `mvn dependency:list -DexcludeDeclaredScopes=test` would then list 
exactly what a release carries.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to