apache/maven · error · ArtifactNotFoundException

Unable to determine the release version

Error message

Unable to determine the release version

What it means

ReleaseArtifactTransformation.transformForResolve handles artifacts whose literal version is 'RELEASE'. It resolves a concrete release version from repository metadata; if resolveVersion still returns 'RELEASE', no usable release versioning metadata was found and ArtifactNotFoundException('Unable to determine the release version') is thrown. Unreadable metadata (RepositoryMetadataResolutionException) is instead surfaced as ArtifactResolutionException with the underlying message.

Source

Thrown at compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/transform/ReleaseArtifactTransformation.java:51

/**
 * Change the version <code>RELEASE</code> to the appropriate release version from the remote repository.
 *
 */
@Named("release")
@Singleton
@Deprecated
public class ReleaseArtifactTransformation extends AbstractVersionTransformation {

    @Override
    public void transformForResolve(Artifact artifact, RepositoryRequest request)
            throws ArtifactResolutionException, ArtifactNotFoundException {
        if (Artifact.RELEASE_VERSION.equals(artifact.getVersion())) {
            try {
                String version = resolveVersion(artifact, request);

                if (Artifact.RELEASE_VERSION.equals(version)) {
                    throw new ArtifactNotFoundException("Unable to determine the release version", artifact);
                }

                artifact.setBaseVersion(version);
                artifact.updateVersion(version, request.getLocalRepository());
            } catch (RepositoryMetadataResolutionException e) {
                throw new ArtifactResolutionException(e.getMessage(), artifact, e);
            }
        }
    }

    @Override
    public void transformForInstall(Artifact artifact, ArtifactRepository localRepository) {
        ArtifactMetadata metadata = createMetadata(artifact);

        artifact.addMetadata(metadata);
    }

    @Override

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Pin an explicit release version instead of RELEASE to make the build reproducible
  2. Verify the artifact exists in a release repository and its maven-metadata.xml <versioning><release> is populated
  3. Run mvn -U once online to refresh metadata, then retry
  4. If you maintain the artifact, run a release deployment so release metadata is generated

Example fix

<!-- before -->
<version>RELEASE</version>

<!-- after -->
<version>1.4.2</version>
Defensive patterns

Strategy: validation

Validate before calling

import org.apache.maven.artifact.Artifact;

boolean isReleaseMetaversion(Artifact a) {
    return Artifact.RELEASE_VERSION.equals(a.getVersion());
}

if (isReleaseMetaversion(artifact)) {
    throw new IllegalArgumentException(
        "RELEASE metaversion is non-reproducible and needs release metadata; pin a version for "
            + artifact.getId());
}

Try / catch

try {
    transformer.transformForResolve(artifact, request);
} catch (ArtifactNotFoundException e) {
    if ("Unable to determine the release version".equals(e.getMessage())) {
        advisePinning(artifact); // replace RELEASE with a concrete released version
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: A dependency or plugin declared with <version>RELEASE</version> where no repository provides maven-metadata.xml with release versioning for the artifact — never-deployed artifact, unreachable repository, or metadata listing only snapshots.

Common situations: Templates or old docs using the RELEASE metaversions; artifacts published only to snapshot repositories; corporate mirrors that fail to merge versioning metadata; offline CI agents without cached metadata.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/a68f07fe5c5892c2. Report an issue: GitHub.