Publish custom maven artifact/package (*.jar) to Azure artifact as well as to Nexus using azure DevOps pipeline

Viewed 10

I want to push my custom artifact/package (*.jar) to the Azure artifact & Nexus using maven with the help of Azure DevOps pipeline. I am using java & building the package using maven.

I can do it by the below scripts/commands in the Azure pipeline.

 mvn deploy:deploy-file -DgroupId="com.mypkg" `
-DartifactId="my.artifact" `
-Dversion="1.0.0-SNAPSHOT" `
-Dpackaging=jar `
-Dfile="my.artifact-1.0.0-SNAPSHOT.jar" `
-DgeneratePom="true" `
-DrepositoryId="$AZURE_FEED_ID" `
-Durl="$AZURE_FEED_URL";

I want to know if this can be done by a single "- task: Maven@3" without writing this task for both Nexus & AZ artifacts.

and what if we have more than one artifact (different groupID & artifactID) to be deployed to both Nexus & AZ artifact

0 Answers
Related