hawkeye
hawkeye

Reputation: 35702

Is SNAPSHOT or non-SNAPSHOT the convention for libraries and Maven when doing a release for others to use?

I'm excluding this from the trunk vs branch release question because that's a separate issue.

Assuming you have finished your development iteration, and are pushing out a release for other people to use in their projects.

Now some members of my team say:

SNAPSHOT is for iterating in your team - and non-SNAPSHOTs are for actual releases.

But when I look at the reactor plugin and associated commentary - it appears to say the opposite:

You're only supposed to release SNAPSHOT versions. That means your version number would be like 3.0.3-SNAPSHOT.

My question is: Is SNAPSHOT or non-SNAPSHOT the convention for libraries and Maven when doing a release for others to use?

Upvotes: 0

Views: 1059

Answers (2)

Gerold Broser
Gerold Broser

Reputation: 14762

See Maven: The Complete Reference, 3.3.1. Project Versions:

SNAPSHOT Versions

Maven versions can contain a string literal to signify that a project is currently under active development. If a version contains the string “-SNAPSHOT,” then Maven will expand this token [...] when you install or release this component.

...

Why would you use this? SNAPSHOT versions are used for projects under active development. [...], if the next release of your system is going to have a version "1.4", your project would have a version "1.4-SNAPSHOT" until it was formally released.

...

When releasing a project, you should resolve all dependencies on SNAPSHOT versions to dependencies on released versions. If a project depends on a SNAPSHOT, it is not stable as the dependencies may change over time. [...] SNAPSHOT versions are for development only.

[Emphasizes by me.]

This means for me:

From a technical POV one can release any version, snapshot or not. But a (technically) released snapshot version is not a (formally) released version from a semantical POV.

Upvotes: 0

rajadilipkolli
rajadilipkolli

Reputation: 3601

SNAPSHOT is assigned when development is under progress, after completion of development we need to release, then your version will not include SNAPSHOT. You can cross verify this in Internet. No jar which we use for general purpose contains SNAPSHOT. At the end they all are GA (General Available) releases.

Example: spring-data-mongodb-1.9.2.RELEASE. So what your team members told is true.

Upvotes: 0

Related Questions