Artifact #
A Maven artifact is the output of a build process. It can for instance be a jar.
Coordinates #
A Maven artifact is identified by so-called coordinates:
- groupId: identifier of the organization that created the project (this is usually the organization’s reversed domain name),
- artifactId: identifier of the project within the group,
- version: version of the artifact.
Examples.
<groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>33.1.0-jre</version><groupId>com.github.haifengl</groupId> <artifactId>smile-core</artifactId> <version>3.1.0</version>
These coordinates are notably used to declare dependencies.
Versions #
SemVer #
Maven artifact versions often follow (or loosely follow) the so-called semantic versioning scheme.
MajorVersion.MinorVersion
or
MajorVersion.MinorVersion.Patch
Example. According to the SemVer scheme, Version
3.4.1means:
- major version:
3- minor version:
4- patch:
1
By convention:
- a new major version often signals the absence of backward compatibility,
- a new minor version often signals (backward compatible) new features,
- a patch often signals bug (or security-related) fixes.
Note. Java has only one major version. For instance “Java 17” actually refers to Java
1.17.
SNAPSHOT #
The
SNAPSHOTqualifier (e.g. in Version3.4.1-SNAPSHOT) indicates an upcoming release, still under development.
The SNAPSHOT qualifier is typically used to describe the (current state of) the source code of (a git branch of) a project (e.g. available as a public git repository).
For instance, if the latest release of the project was 3.5.2, and if the developers are working on bug fixes, then the latest source code may have Version 3.5.3-SNAPSHOT.
Warning. A program whose version number has the
SNAPSHOTqualifier may be modified by it authors, while keeping the same version number. In other words,Version 3.4.1-SNAPSHOTdownloaded today may differ fromVersion 3.4.1-SNAPSHOTdownloaded tomorrow. So when releasing a project, it is recommended to avoid dependencies onSNAPSHOTversions.