What is the difference between Update Snapshots and Update Dependencies in m2eclipse?

Assuming you are already using the m2eclipse plugin, if you right-click on the Maven project, you will see the Maven submenu.

Two of the actions available in this submenu are:

  • Update Dependencies
  • Refresh snapshots

I found an answer that says “Update snapshots” is equivalent to using the -U option for mvn.

If the "update snapshots" match mvn -U , what does the "update dependency" do?

+6
source share
2 answers

This largely depends on how the snapshot update policy is set in your environment. By default, Maven should update snapshots once a day (hence the -U and "Update snapshots" action to force the snapshot to be updated), but this policy can be overwritten locally or at the repository manager level.

Update Dependencies does almost the same thing as the Update Snapshots action, except that you update snapshot artifacts. Both projects are reset in the memory model created by M2E to track dependencies, including those obtained from the Eclipse workspace.

+1
source

Snapshots are dependencies, but are used slightly differently. The specific dependency is determined using the group, name and version. These attributes may be the same for two different shots. Maven uses the latest snapshot based on the internal timestamp.

Templates are useful when developing a project where you do not want to change your version, but want your users to use the latest build.

So ... "update dependencies" loads dependencies that you don’t have, leaving those that you have untouched, "update snapshots" update your snapshots in place until the last build.

Hope this helps.

+2
source

Source: https://habr.com/ru/post/909280/


All Articles