0

For either STS or Eclipse for a project based in Maven, when in the pom.xml file a new dependency is added, normally I do:

  • select project -> right click -> Maven -> Update Project...

All go well.

I did do a research about to accomplish the same goal through a command. I found the following:

According with that can be used mvn dependency:resolve.

If I do this through Run Configurations to create a Maven Build item, well through either dependency:resolve or dependency:resolve -U in many machines for different projects many times it fails, it indicating that the new dependencies can't be resolved.

Notes:

  • Bandwidth is ok.
  • I have never had this problem through Maven -> Update Project.... It works fine. The new dependencies are downloaded.
  • In the Goals field, the mvn term must be not used, it is used or included implicitly, otherwise arises an error.

So I am assuming that dependency:resolve really does not represent Maven -> Update Project...

So what is the correct command?

Manuel Jordan
  • 11,959
  • 15
  • 69
  • 111
  • m2e (which is the eclipse plugin, that brings the capability to understand maven poms) is not really executing a single maven command but using several internal maven APIs to achieve the same. But dependency:resolve should really do the trick. Did the errors where listed in the console or within the POMs editor? I would have suggested that maven phase `generate-sources` or `generate-test-sources` should be as near as possible to "Update Projects" – Robert Kleinschmager Jun 10 '20 at 15:31

0 Answers0