-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optional
tag in dependencyManagement
is not inherited
#3533
Comments
optional
tag in dependencyManagement
not inheritedoptional
tag in dependencyManagement
is not inherited
If you move the optional tag into the module pom but you use a central property (e.g. Ultimately, this feels like a bug in maven, so I don't really want to decentralize our pom files just to make up for their bug. |
This works for me.
The question is whether we want these dependencies to be pulled transitively.
FWIW, Line 84 in b14c36d
|
The optional is what we want, we've had complaints in the past about pulling in large dependency trees that people don't use. We refactored the pom files a while ago to clean them up, we must have missed that one. If you wanted to send a PR to clean it up, that'd be great :) |
Describe the bug
The
client-java-parent
POM has a few "optional" dependencies; however, they are no-ops. For example, the dependency tree of a module that usesio.kubernetes:client-java:jar:19.0.1
:This is because Maven doesn't take the tag into account. See also https://issues.apache.org/jira/browse/MNG-5227 and https://issues.apache.org/jira/browse/MNG-5632. We noticed this issue, because Coursier seems to take the tag into account unlike Maven.
Could we push optional tags to module POMs and drop them from
dependencyManagement
?java/pom.xml
Lines 185 to 190 in d7f9391
java/util/pom.xml
Lines 14 to 17 in d7f9391
Client Version
19.0.1
Kubernetes Version
1.26.15
Java Version
Java 21
To Reproduce
client-java
and runmvn dependency:tree
.io.prometheus:simpleclient:jar:0.16.0:compile
will be listed there.Expected behavior
Optional dependencies (e.g.,
io.prometheus:simpleclient
) should not be pulled transitively in downstream modules.KubeConfig
N/A
Server (please complete the following information):
N/A
The text was updated successfully, but these errors were encountered: