My artifactory has two repos:
libs-snapshot-local
libs-release-local
Layout for both: [orgPath]/[module]/[baseRev]([folderItegRev])/[module][baseRev]([fileItegRev])([classifier]).[ext] (or maven2-default)
When I run the Jenkins Pipeline the artifacts are always uploaded to libs-release-local. Note that I do not explicitly use -SNAPSHOT modifier in my pom files. Snapshots have version with build number (e.g. 1.0.0-010) while release only has version (e.g. 1.0.0). I am distinguishing snapshot vs release based on branch name.
rtMaven.deployer releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
Jenkins code:
stage('Build') { def server = Artifactory.server "server1" def buildInfo = Artifactory.newBuildInfo() def rtMaven = Artifactory.newMavenBuild() rtMaven.tool = 'Maven3' rtMaven.deployer releaseRepo:'libs-release-local', snapshotRepo:'libs-snapshot-local', server: server rtMaven.run pom: 'pom.xml', goals: 'clean install -Dmaven.test.skip=true', buildInfo: buildInfo publishBuildInfo server: server, buildInfo: buildInfo }
How does the Artifactory plugin decide if it should go to release vs snapshot repo here? Is it the fileItegRev? or folderItegRev?
If the plugin makes a decision based on -SNAPSHOT modifier and is not flexible then how can have all the dependencies etc that the plugin does (with rtMaven.deployer) but using uploadSpec instead.