This is how you can publish your custom jar files as Maven artifacts and use them as dependencies in your projects:
- Make sure you have an Azure Artifact feed in Azure DevOps or create one if needed:
- The command below will generate a Maven artifact. Please upload the pom.xml and jar file to the Azure DevOps Repo if you don't have one ready: mvn -B archetype:generate -DarchetypeGroupId="org.apache.maven.archetypes" -DgroupId="MyGroup" -DartifactId="myFirstApp"
-
From the "Connect to feed" in Azure DevOps, select the Maven, and copy the <repository> information:
- Paste <repository> information from the last step, into your pom.xml file twice in <repositories> and <distributionManagement> tags
- Create a pipeline in Azure DevOps:
- You can also use settings.xml file to authenticate the Azure DevOps Maven feed in your pipeline.
- Configure the feed permission in case of access related issues
- Select the Packages from your feed in Azure DevOps, and copy the contents of the <dependency> element:
- Paste the <dependency> element content copied in the last step, inside the <dependencies> element of your project pom.xml file.
- Run "mvn install" from the directory that contains your project pom.xml file.
Updated May 20, 2024
Version 1.0Jaswant_Singh
Microsoft
Joined January 05, 2023
Healthcare and Life Sciences Blog
Follow this blog board to get notified when there's new activity