If the dependency is a unique snapshot version and install is called, what does maven select?

落花浮王杯 提交于 2019-12-05 20:08:55
Pascal Thivent

When using a dependency with a timestamp version of a -SNAPSHOT - like -20100518.134928-9 in this case - you lock the version and explicitly tell Maven to use this version. Even if a new -SNAPSHOT is build, the dependency won't get updated, that's the point of a "locked snapshot".

If you want to use the latest -SNAPSHOT, declare a dependency on the -SNAPSHOT version to unlock the dependency:

<dependency>
  <groupId>org.example</groupId>
  <artifactId>framework-core</artifactId>
  <version>1.1.0-SNAPSHOT</version>
</dependency>

Changing it manually is not a big deal but the following goals of the Versions Maven plugin might help in some situations:

  • versions:lock-snapshots searches the pom for all -SNAPSHOT versions and replaces them with the current timestamp version of that -SNAPSHOT, e.g. -20090327.172306-4
  • versions:unlock-snapshots searches the pom for all timestamp locked snapshot versions and replaces them with -SNAPSHOT. versions:unlock-snapshots
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!