wilx opened a new pull request, #1340:
URL: https://github.com/apache/maven-assembly-plugin/pull/1340

   Fixes #1146.
   
   ## Summary
   
   Resolve nested module-set dependency sets from the selected module projects
   instead of from the project producing the assembly.
   
   The regression test contains selected and unrelated module trees. It verifies
   both the dependency set implied by `includeDependencies=true` and an 
explicitly
   configured nested dependency set with `includeDependencies=false`. In both
   cases, the archive must contain only the selected module and its dependency.
   
   ## Root cause
   
   The module-set overload of 
`DefaultDependencyResolver.resolveDependencySets()`
   first added dependencies of the assembly project. It added dependencies of 
the
   selected modules only when `includeDependencies` was enabled. This caused
   unrelated dependencies of the assembly project to leak into nested dependency
   sets and prevented explicit nested dependency sets from resolving selected
   module dependencies when `includeDependencies` was disabled.
   
   Module-set dependency resolution now uses only the projects selected by the
   module set. Explicit nested dependency sets are resolved independently of the
   `includeDependencies` shortcut. When that option is disabled and no explicit
   sets exist, `ModuleSetAssemblyPhase.getDependencySets()` still returns an 
empty
   list, so no dependencies are added.
   
   The change retains the per-dependency-set isolation introduced for
   MASSEMBLY-619 and the scope-aware Maven Resolver implementation introduced 
for
   MASSEMBLY-1008. The integration tests for both earlier fixes continue to 
pass.
   
   ## Compatibility and verification
   
   - Maven 3.9.16: `mvn -Prun-its clean verify` passed with 268 unit tests and 
all
     151 Invoker builds.
   - Maven 4.0.0-rc-5: `mvn clean verify` passed with 268 unit tests.
   - The processed MASSEMBLY-940 integration-test reactor was run directly with
     Maven 4.0.0-rc-5 and produced the expected archive contents.
   
   The Maven 4 outer Invoker run is currently affected by Maven Invoker 3.10.1
   passing `-D maven.repo.local=...` as two arguments. This is independent of 
this
   change; the same processed integration-test project passes when Maven 
receives
   the correctly formed `-Dmaven.repo.local=...` argument.
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [x] Your pull request should address just one issue, without pulling in 
other changes.
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [ ] Each commit in the pull request should have a meaningful subject line 
and body.
     Note that commits might be squashed by a maintainer on merge.
   - [ ] Write unit tests that match behavioral changes, where the tests fail 
if the changes to the runtime are not applied.
     This may not always be possible but is a best-practice.
     This reactor-dependent behavior is covered by an Invoker integration test 
that fails without the runtime change.
   - [x] Run `mvn verify` to make sure basic checks pass.
     A more thorough check will be performed on your pull request automatically.
   - [x] You have run the integration tests successfully (`mvn -Prun-its 
verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
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