简体   繁体   中英

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 .

IntelliJ 2017.2的屏幕截图>首选项/设置>构建,执行,部署>构建工具> Maven>始终更新快照(复选框)

➠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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM