What is a -SNAPSHOT version in Maven?
Options
- A stable release that never changes after publishing
- A development version that can change over time (Correct option)
- A version that cannot be built with Maven or Gradle
- A backup copy of the release kept in a repository
Answer
A development version that can change; Maven may re-download it as it is updated, unlike an immutable release
Why
A version such as 1.2.0-SNAPSHOT means "work in progress toward 1.2.0". The artifact with that same version can be replaced many times.
A release version like 1.2.0 should never change once published: anyone who depends on it gets exactly the same bytes.
Good practice: never depend on SNAPSHOTs in production builds, because the build is not reproducible.
Remember
SNAPSHOT = mutable work in progress; release = fixed forever.