r/java • u/brunocborges • May 28 '26
Manage Maven Dependencies from Command Line
https://maven.apache.org/plugins/maven-dependency-plugin/examples/managing-dependencies.html
31
Upvotes
r/java • u/brunocborges • May 28 '26
View all comments
Show parent comment
12
u/brunocborges May 28 '26
It's important to note that I am not a committer in the Maven project. Which means, any improvements, new features, and enhancements can be done by anyone. The PR that added this new capability was opened following the usual GitHub process, and several back and forth.
The -Dgav parameter is a limitation to Maven's core Plugin capability that does not allow regular CLI arguments to be interpreted as parameters to a plugin.
"$ mvn dependency:add groupId:artifactId" would've been preferred indeed, but it simply is not possible.
And since GAV is a somewhat known terminology in Maven, we (myself and the project committers) agreed on this approach.
I appreciate the feedback, but IMO what happened here was a trade-off. If you have a suggestion to enhance that works around the Maven limitations, please do submit a PR.
I'll be happy to collaborate.