Exclude transitive reactor dependencies#1659
Conversation
| import org.eclipse.aether.resolution.DependencyResolutionException; | ||
| import org.eclipse.aether.resolution.DependencyResult; | ||
| import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator; | ||
| import org.jspecify.annotations.Nullable; |
There was a problem hiding this comment.
No new dependencies is needed for it?
I would like to not introduce it.
elharo
left a comment
There was a problem hiding this comment.
Test failure probably related:
alhost:38227 is stopped.
[INFO]
[INFO] --- dependency:3.11.0:analyze-only (analyze) @ maven-dependency-plugin ---
Error: Used undeclared dependencies found:
Error: org.jspecify:jspecify:jar:1.0.0:provided
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:46 min
[INFO] Finished at: 2026-07-17T17:11:13Z
[INFO] ------------------------------------------------------------------------
Error: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.11.0:analyze-only (analyze) on project maven-dependency-plugin: Dependency problems found -> [Help 1]
|
Thank you for the comments. I've removed the annotation since I did not find any equivalent used in the project. |
Issue
in a multi-module project, if module A depends on module B and module B on module C, then goals go-offline will attempt to pull module C when handling module A - which is against the spirit of excluding reactor artifacts.
Fix
The
DependencyRequestinresolveDependenciesForArtifactnow takes a filter, that will take care of transitive dependenciesFollowing this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
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 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
you have to acknowledge this by using the following check-box.