Troubleshoot Java package issues

Learn about troubleshooting steps that you might find helpful if you run intoproblems managing java packages in Artifact Registry.

Can't resolve a dependency stored in Artifact Registry

Maven resolves some dependencies before applying a wagon defined inpom.xml, including:

  • References in a child Maven project to a parent project using the<parent> element.
  • Plugin dependencies stored in Artifact Registry.

If your project needs to resolve these dependencies, you must use thecore extensionsmechanism to ensure that Maven can locate parent POM files and plugins.

In your project, create the file${maven.projectBasedir}/.mvn/extensions.xmlwith the following content. The<extension> element defines thewagon.

<extensionsxmlns="http://maven.apache.org/EXTENSIONS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0http://maven.apache.org/xsd/core-extensions-1.0.0.xsd"><extension><groupId>com.google.cloud.artifactregistry</groupId><artifactId>artifactregistry-maven-wagon</artifactId><version>2.2.5</version></extension></extensions>

Can't upload non-unique snapshots to a snapshot repository

You can upload snapshot versions that do not exist in an Artifact Registrysnapshot repository, but you cannot overwrite a version that already exists inthe repository.

Non-unique snapshots are a feature of Maven 2. Maven 3 always adds a timestampto snapshot version numbers so that every snapshot version is unique.

Artifact Registry only supports non-unique snapshot versions inrepositories with a snapshot version policy. By default snapshot repositoriesonly accept unique snapshot versions. You can only set a version policy whenyou create the repository.

To find out the version policy settings for a repository, run the followingcommand:

gcloudartifactsrepositoriesdescribeREPOSITORY\[--project=PROJECT]\[--location=LOCATION]

Where

  • REPOSITORY is the ID of the repository. If you configured adefault Artifact Registryrepository, it is used when this flag is omitted from the command.
  • PROJECT is the project ID. If this flag is omitted,the current ordefault project is used.
  • LOCATION is the regional or multi-regionallocation for the repository.

The output of the command includes information about the version policyundermavenConfig. In the following example, the repository has a snapshotversion policy and snapshots cannot overwrite identical versions in therepository.

Encryption: Google-managed keycreateTime: '2021-09-23T19:39:10.897404Z'format: MAVENmavenConfig: allowSnapshotOverwrites: false versionPolicy: SNAPSHOT

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.