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

<project xmlns="http://maven.apache.org/POM/4.0.0" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
   http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>CoreJavaTutorials</groupId>
   <artifactId>CoreJavaTutorials</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>jar</packaging>
   <url>http://maven.apache.org</url>
</project>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值