Maven
http://maven.apache.org/guides/index.html
Build lifecycle
These build phases (plus the other build phases not shown here) are executed sequentially to complete the default lifecycle. Given the build phases above, this means that when the default lifecycle is used, Maven will first validate the project, then will try to compile the sources, run those against the tests, package the binaries (e.g. jar), run integration tests against that package, verify the package, install the verifed package to the local repository, then deploy the installed package in a specified environment.
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
POM
version
The "SNAPSHOT" term means that the build is a snapshot of your code at a given time.
It usually means that the version is a version still under heavy development.
The three others answers provide you a good vision of what a -SNAPSHOT
version is. I just wanted to add some information regarding the behavior of Maven when it finds a SNAPSHOT
dependency.
When you build an application, Maven will search for dependencies in the local repository. If a stable version is not found there, it will search the remote repositories (defined in settings.xml
or pom.xml
) to retrieve this dependency. Then, it will copy it into the local repository, to make it available for the next builds.
For example, a foo-1.0.jar
library is considered as a stable version, and if Maven finds it in the local repository, it will use this one for the current build.
Now, if you need a foo-1.0-SNAPSHOT.jar
library, Maven will know that this version is not stable and is subject to changes. That's why Maven will try to find a newer version in the remote repositories, even if a version of this library is found on the local repository. However, this check is made only once per day. That means that if you have a foo-1.0-20110506.110000-1.jar
(i.e. this library has been generated on 2011/05/06 at 11:00:00) in your local repository, and if you run the Maven build again the same day, Maven will not check the repositories for a newer version.
Maven provides you a way to can change this update policy in your repository definition:
<repository>
<id>foo-repository</id>
<url>...</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>XXX</updatePolicy>
</snapshots>
</repository>
where XXX
can be:
- always: Maven will check for a newer version on every build;
- daily, the default value;
- interval:XXX: an interval in minutes (XXX)
- never: Maven will never try to retrieve another version. It will do that only if it doesn't exist locally. With the configuration,
SNAPSHOT
version will be handled as the stable libraries.
(model of the settings.xml can be found here)
from http://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it
'Dev' 카테고리의 다른 글
Print multiple values in a row by using ArrayList.subList (0) | 2015.11.18 |
---|---|
Difference between start and run method in Thread in Java (0) | 2015.08.07 |
Windows XP 탐색기에서 이미지 미리보기 제거 (0) | 2013.01.27 |
Windows XP 자동실행 기능 막는 방법 (0) | 2013.01.27 |
속도 비교 : For문 비교하여 값 얻어내기 vs 디비 접속하여 값 얻어내기 (0) | 2011.08.04 |