Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between "Update snapshots" and "Update dependencies" in m2eclipse?

Assuming you're already using the m2eclipse plugin, if you right-click on a Maven project there is a Maven submenu.

Two of the actions available in this submenu are:

  • Update dependencies
  • Update snapshots

I've found an answer that says that "Update snapshots" is equivalent to using the -U parameter for mvn.

If "update snapshots" is the same as mvn -U what does "update dependencies" do?

like image 308
Serxipc Avatar asked Feb 24 '12 14:02

Serxipc


People also ask

What does force update of snapshots releases do?

The flag of –U update snapshots will force you to check the updated snapshots and missing releases from the remote repositories. The below example shows how we can update the maven with the force option as follows. We are using the mvn clean install command with –U options for force updating.

How do I update dependencies in Eclipse?

Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.

How often does maven check for snapshot updates?

xml. data-service project is releasing 1.0-SNAPSHOT for every minor change. Although, in case of SNAPSHOT, Maven automatically fetches the latest SNAPSHOT on daily basis, you can force maven to download latest snapshot build using -U switch to any maven command.

What does Maven update project do?

What does "Maven -> Update Project..." do in Eclipse? It just makes a refresh to reload the maven configuration file again.


2 Answers

Snapshots are dependencies, but used slightly differently. Specific dependency is determined using group, name and version. These attributes can be identical for two different snapshots. Maven uses the latest snapshot based on internal time stamp.

Shapshots are beneficial during development of the project where you don't want to change its version but want your users to use the latest build.

So... "update dependencies" downloads dependencies you don't have, leaving the ones you have intact, "update snapshots" updates your snapshots in place to the latest build.

I hope this helps.

like image 141
Eugene Ryzhikov Avatar answered Oct 03 '22 14:10

Eugene Ryzhikov


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

The "Update Dependencies" does pretty much the same as "Update Snapshots" action, except forcing updating snapshot artifacts. Both actions reset in-memory project model created by M2E to keep track of dependencies, including those that came from Eclipse Workspace.

like image 42
Eugene Kuleshov Avatar answered Oct 03 '22 15:10

Eugene Kuleshov