Use packages from Maven Central

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018

With upstream sources, you can use both private packages you've created and public packages from Maven Central. When you enable upstream sources in your feed, Azure Artifacts will save a copy of any packages you install from Maven central. Azure Artifacts also support other Maven upstream sources such as Google Maven Repository, Gradle Plugins, and JitPack.

Note

Maven snapshots are not supported with Maven upstream sources.

Enable upstream sources

Follow the instructions below to create a new feed and enable upstream sources:

  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Artifacts, and then select Create Feed.

    A screenshot showing the create a feed button.

  3. Provide a descriptive Name for your feed and specify its Visibility (determining who can view packages within the feed). Additionally, configure the Upstream sources and specify the Scope of your feed (project-scoped or organization-scoped).

    A screenshot showing how to create a need feed.

  4. Select Create when you're done.

Note

When creating a new feed, the default access level for the Project Collection Build Service (organization-scoped) and the project-level Build Service(project-scoped) is set to Collaborator.

Azure Artifacts comes pre-installed in TFS 2018. If this is the first time using your feed, you might be asked to assign a license

  1. Go to Build & Release and select Packages.

    Go to Azure Artifacts TFS

  2. Select + New feed.

    New feed button TFS

  3. Give your feed a Name, a Description, and set up who can read, who can contribute and if you want to Include external packages.

    New feed dialog box TFS

  4. Select Create when you're done.

Add Maven Central upstream

  1. Select the gear icon in the top right of the page to access your feed's settings.

  2. Select Upstream sources.

  3. Select Add Upstream.

  4. Select Public source, and then select Maven Central (https://repo.maven.apache.org/maven2/) from the dropdown menu.

    A screenshot showing how to add Maven central upstream source.

  5. Select Save when you are done.

  6. Select Save to save your changes.

    A screenshot showing how to save changes in upstream sources

View saved packages

You can view the packages you saved from upstreams by selecting the Maven Central source from the dropdown menu.

A screenshot showing how to filter for packages from Maven Central.

Tip

If Maven is not downloading all your dependencies, run the following command from the project directory to regenerate your project's files: mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true