Avatar ·

What is Maven SNAPSHOT and why is it needed in Java projects?

Hi everyone! I'm new to Java and Maven, working on a small project where I use an external library that we are also developing in parallel. In the pom.xml file, I specified a dependency with version `1.0.0-SNAPSHOT`, but my team lead said this is not for production, only for development.\n\nI don't fully understand the difference between a regular version (e.g., `1.0.0`) and `SNAPSHOT`. They both seem like versions. When I run `mvn clean install`, Maven sometimes complains that it can't find `1.0.0-SNAPSHOT` locally, even though I just built the library. Other times, it pulls an old version even though I've already made changes.\n\nPlease explain in simple terms what Maven SNAPSHOT is? Why was it invented? And how to work with it correctly to avoid confusion with versions? Especially