Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (7k points)
edited by
We have one project which has files shared across several others so the maven compile for that project creates a .jar file. When I compile the micro services on my laptop, they each have a dependency on the jar file in my repo. And they pick up the related dependency and the Maven build.​

But, the code build pipeline does not maintain a local repo. So when I try to do “mvn clean install” on each micro service they cannot locate shared.jar and the build fails.​

1 Answer

0 votes
by (31.9k points)
edited by

Have a separate pipeline to build the dependency which deploys it to an Azure feed:


        - name: mavenRepoURL

          value: ''

        - task: DownloadSecureFile@1

          name: mvnSettings

          displayName: 'Download Maven settings'


            secureFile: 'maven-azuredevops-settings.xml'

        - task: MavenAuthenticate@0

          displayName: Maven Authenticate Artifacts


            artifactsFeeds: 'myfeed'

        - task: Maven@3


            mavenPomFile: 'pom.xml'

            options: '-X -B -s $(mvnSettings.secureFilePath) -DWHERE="AzureDevops" -DremoteRepositories=$(mavenRepoUrl) clean deploy -U'

            mavenAuthenticateFeed: true

            publishJUnitResults: true

            testResultsFiles: '**/TEST-*.xml'

Add dependency to pom for the project using it as normal and with Azure feed configured as well






























Want to become Azure Developer, check out this Azure Tutorial.

Want more insights on Azure, visit the Azure Training page.

Related questions

0 votes
1 answer
asked Nov 22, 2020 in Azure by Justin (7k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories