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. Select Artifacts, and then select Create Feed.

    Create a feed button

  2. Give your feed a Name and choose its visibility (who can view packages in this feed), upstream sources, and scope (project-scoped or organization-scoped) settings.

    New feed dialog box

  3. Select Create when you're done.

Note

By default, the Project Collection Build Service (org-scoped) and the project-level Build Service (project-scoped) are set to Collaborator when you create a new feed.

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