Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the IntelliJ 2017.2 setting for Maven “Always update snapshots” do?

This Question is answered successfully by checking Preferences/Settings > Build, Execution, Deployment > Build tools > Maven > Always update snapshots (checkbox) in IntelliJ IDEA.

screen shot of IntelliJ 2017.2 > Preferences/Settings > Build, Execution, Deployment > Build Tools > Maven > Always update snapshots (checkbox)

➠What exactly does that setting do?

The documentation is unhelpful.

Always update snapshots

Select this checkbox, if you want IntelliJ IDEA to update snapshots on sync.

  • What snapshots?
  • In sync with what?
  • Why would I not want to stay in sync?
  • Why is this not checked by default?
like image 503
Basil Bourque Avatar asked Oct 24 '17 19:10

Basil Bourque


1 Answers

My guess is that since SNAPSHOT dependencies may be continually worked on, that they may have changes while in development. As for your questions:

  • What snapshots?

Any snapshot dependencies you have in your pom.xml (or equivalent). This would typically (but not necessarily) be anything that you depend on with a version ending in '-SNAPSHOT'.

  • In sync with what?

With the repository you initially pulled it from. Maven has its own local cache, ".m2" (and actually, IntelliJ has its own Maven cache as well), so it's asking if it should pull it down from the repo even if you have a local copy.

  • Why would I not want to stay in sync?

If you found a "version" of the snapshot version that works, you may just want to use it until the release build is out. It also increases build times to pull down new versions, and uses up bandwidth (although that should probably not be an issue).

  • Why is this not checked by default?

Because if an update is suddenly pushed that breaks things, it could be frustrating/unreliable/etc.

However, if you're waiting for a certain feature to be implemented and you need it ASAP, or if you're working on the dependency project and constantly updating it while debugging, then keeping SNAPSHOT dependencies up-to-date may make sense.

like image 69
Igor Avatar answered Sep 27 '22 19:09

Igor