Squirrel
Squirrel

Reputation: 1523

Artifactory Maven layout version

I would like to know what dictates when an artifact is deployed to snapshot vs release repo.

Artifactory has two repos:

  1. libs-snapshot

  2. libs-release

Layout for both: [orgPath]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext]

When I run the Jenkins Pipeline the artifacts are always uploaded to libs-release. Note that I do not explicitly put a 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)

rtMaven.deployer releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot', server: rtServer

How does the Artifactory plugin decide if it should go to release vs snapshot repo here? Is it the fileItegRev? or folderItegRev?

Upvotes: 0

Views: 93

Answers (1)

raspy
raspy

Reputation: 4261

A snapshot is a version that ends with -SNAPSHOT. It has to be in the path of the artifact to deploy, as gathered by build info extractor.

Relevant code is:

public String getTargetRepository(String deployPath) {
    return StringUtils.isNotBlank(snapshotRepo) && deployPath.contains("-SNAPSHOT") ? snapshotRepo : releaseRepo;
}

Upvotes: 1

Related Questions