Home > Enterprise >  Remove suffix from snapshot upload to Artifactory from Azure DevOps
Remove suffix from snapshot upload to Artifactory from Azure DevOps

Time:09-28

Intent: Build and deploy Maven artifact build on Azure DevOps to JFrog Artifactory

Build Platform: Azure DevOps

Repository: JFrog Artifactory (Maven)

My current pom file version is like: 0.0.1-SNAPSHOT

I am using ADO's Artifactory Maven Plugin Task to build and publish to Artifactory.

Issue: When publishing the files (jar and pom), a datetime suffix string is being appended to the name of the jar and pom files. enter image description here

Here's my pipeline definition

- task: ArtifactoryMaven@2
  inputs:
    mavenPomFile: 'pom.xml'
    goals: 'install'
    artifactoryResolverService: 'jfrog-service-connection'
    targetResolveReleaseRepo: 'jfrog-maven-repo'
    targetResolveSnapshotRepo: 'jfrog-maven-repo'
    artifactoryDeployService: 'jfrog-service-connection'
    targetDeployReleaseRepo: 'jfrog-maven-repo'
    targetDeploySnapshotRepo: 'jfrog-maven-repo'
    collectBuildInfo: true
    options: '-DuniqueVersion=false'
    # buildName: '$(Build.DefinitionName)'
    # buildNumber: '$(Build.BuildNumber)'
  displayName: 'Build and Deploy to repo'

I am using this input options: '-DuniqueVersion=false' as an argument for mvn clean install while the option is found for mvn deploy.

Can someone please suggest the correct way to drop the suffix and upload the artifacts as is? THIS

my-artifact-0.0.1.jar 
my-artifact-0.0.1.pom

INSTEAD OF

my-artifact-0.0.1-20210927.044504-1.jar 
my-artifact-0.0.1-20210927.044504-1.pom

Thanks in advance!

CodePudding user response:

You should consider changing the "Maven Snapshot Version Behavior" from unique to non-unique which should resolve to add the timestamp under the Maven repository | Maven settings. enter image description here

  • Related