Search code examples
mavenmaven-3pom.xml

What is happening when a maven POM dependency just specifies the version as SNAPSHOT and is it a good practice?


I've seen a few people use this format in their pom.xml:

<groupId>com.myProjects.uniqueId</groupId>
<artifactId>my-project</artifactId>
<version>SNAPSHOT</version>
<name>${project.artifactId}</name>

In particular, the version of the project is just specified as SNAPSHOT. This is for a maven 3 project. Is this some deprecated behavior? Is this a poor practice? I've been under the assumption we should always specify the version number explicitly.


Solution

  • This should not be done:

    • Releasing from this is difficult because you have no version number
    • You cannot tell whether SNAPSHOT is older or younger than the last release.
    • it is completely off the standard Maven practise and semantic versioning.