Maven的snapshot是什么?

Basically, while developing a large scale application, the process involves a series of changes to be made in the application till it is confirmed to be ready as a final release. Because, there could be multiple teams working on an application across different set of modules.

基本上,当开发一个大型的可伸缩的应用时,过程中这个应用需要做一系列的修改直到它被确认可以作为一个最终的release版本。因为,有可能有多个team交叉的开发同一个应用的不同模块。

Consider 2 teams A & B working on 2 different modules and say team B will be dependent on the services provided by team A. Say team A is involved in working on some major critical fixes and those fixes will be checked in every day. So team B has to be notified in a way that there are still some pending work by team A and the final version has not yet been released by the team A. This is where the maven's SNAPSHOT comes into the picture.

比如2个team A和B工作在两个不同的模块上进行开发,team B依赖于

Snapshot is a special version which indicates the current development copy of the project which is being worked on. For each build, maven always checks out for a SNAPSHOT of the project.

Hence, whenever maven finds a newer SNAPSHOT of the project, it downloads and replaces the older .jar file of the project in the local repository.

Snapshot version always gets some updates/changes being made on the project. Also, Snapshot should exist only during development phase and it will not be having a release version. This implies that the build of the project will be changed at any time and it is still under the development process.


Snapshot Vs Version

In case of SNAPSHOT, Maven will automatically fetch the latest SNAPSHOT (data-service: 1.0-SNAPSHOT) every time

CoreJavaTutorials project is built.

假如是SNAPSHOT,Maven将在每次CoreJavaTutorials项目被build时自动获取最新版本SNAPSHOT。

In case of Version, maven once downloaded the mentioned version say JavaSamples:1.0, then it will never try to download a newer

1.0 available in repository. To download the updated code, CoreJavaTutorials version is to be upgraded to 1.1.

假如是普通的Version,Maven一旦下载了标明的版本(比方说是1.0),就不再尝试下载一个较新的有效的1.0版本到repository中了。如果要下载更新的代码,CoreJavaTutorials 版本将被升级到1.1


   4.0.0
   CoreJavaTutorials
   CoreJavaTutorials
   1.0-SNAPSHOT
   jar
   http://maven.apache.org

你可能感兴趣的:(maven)