0
votes

When I run my build pipeline, all the libraries will publish to the Azure DevOps Artifacts(Because they will downloaded in Maven Central).

But I have a external libraries which I have created manually on my local computer and it's a jar like this picture.external libraries jar

I want to add this jar to Azure DevOps Artifacts so that when next time I run my pipeline, it can access to my external libraries jar.

How can I do it? I have tried this solution. But it cannot work.

az artifacts universal publish --organization https://dev.azure.com/example/ --feed my_feed --name my-artifact-name --version 0.0.1 --description "Test Description" --path this solution

1

1 Answers

0
votes

You can refer to the document about az artifacts universal publish. Here is my sample:

1.Log into Azure DevOps:

az login

or

az devops login --organization https://dev.azure.com/{Organization}/

2.Publish packages:

My file is in the C:\sample folder:

enter image description here

Here is my command:

az artifacts universal publish --organization https://dev.azure.com/{Organization}/ --feed {Feed name} --name sample.jar --version 0.0.1 --description "Welcome to Universal Packages" --path C:\sample\sample.jar.

enter image description here In addition, it is Organization scoped feeds.

enter image description here

If you are publishing packages to Project scoped feeds, please also add project name in your command:

az artifacts universal publish --organization https://dev.azure.com/{Organization}/ --project="{Project}" --scope project --feed {Feed name} --name my-first-package --version 0.0.1 --description "Welcome to Universal Packages" --path .