0

Today we're using mvn deploy from our build pipeline but need to migrate to building in the build pipeline and deploying from the release pipeline.

In the build pipeline we are doing "mvn package", then publish that jar using Azure DevOps (ADO)'s Copy Files task. However when the Release pipeline runs it always rebuilds before deploying.

- task: Maven@3
  displayName: 'Build Only'
  inputs:
    goals: 'package -DskipTests -B'
    options: '-s settings.xml'
    publishJUnitResults: false

steps:
- task: CopyFiles@2
  displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
  inputs:
    Contents: |
     **\*.jar
     **\*.zip
    TargetFolder: '$(build.artifactstagingdirectory)'

Then in the release pipeline:

steps:
- task: Maven@3
  displayName: 'Deploy to TEST'
  inputs:
    mavenPomFile: '$(System.DefaultWorkingDirectory)/BUILD/drop/s/pom.xml'
    goals: 'jar:jar deploy:deploy site-deploy -DskipTests -Dmaven.install.skip=true'
    publishJUnitResults: false

This is probably an ADO problem rather than a Maven problem trying to get them to see the published artifact.

I did see Deploying maven artifacts without rebuilding and Maven: The packaging for this project did not assign a file to the build artifact but that didn't help.

Thanks!

0 Answers0