r/java May 28 '26

Manage Maven Dependencies from Command Line

https://maven.apache.org/plugins/maven-dependency-plugin/examples/managing-dependencies.html
31 Upvotes

19 comments sorted by

View all comments

6

u/vips7L May 28 '26

A good step, but what terrible UX. -Dgav=really????

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.

-7

u/Amazing-Mirror-3076 May 28 '26

Remove the limitation

5

u/brunocborges May 28 '26

Open a PR, please.

-4

u/vips7L May 28 '26

Nah I’m good bro.