maven 快照
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.
基本上,在开发大型应用程序时,该过程涉及在应用程序中进行一系列更改,直到确认已准备好作为最终版本。 因为,可能会有多个团队在不同模块组上开发应用程序。
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个A和B团队在2个不同的模块上工作,并说B团队将依赖于A团队提供的服务。假设A团队参与了一些重要的关键修复程序,并且每天都会检查这些修复程序。 因此,必须以某种方式通知B团队,A团队仍有一些待完成的工作,而A团队尚未发布最终版本。这就是Maven的SNAPSHOT出现的地方。
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.
Snapshot是一个特殊版本,指示正在处理的项目的当前开发副本。 对于每个构建,maven总是签出项目的快照。
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.
因此,每当maven找到项目的较新版本SNAPSHOT时,它都会下载并替换本地存储库中项目的较旧.jar
文件。
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 ,每次构建CoreJavaTutorials项目时,Maven都会自动获取最新的SNAPSHOT(数据服务:1.0-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一旦下载了提到的JavaSamples:1.0版本,那么它将永远不会尝试下载存储库中可用的更新的1.0。 要下载更新的代码,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>
maven 快照