In a scripted Jenkins pipeline I used the following functionality:
rtMaven.deployer.artifactDeploymentPatterns.addInclude("frog*")
What is the equivalent way to do it in a declarative pipeline?
The declarative examples on the wiki makes no mention of it, whereas the scripted examples do.
Clearly, looking at the souce of the plugin, the functionalty I want is there, and I don't know how to invoke it.
Working, scripted code:
server = Artifactory.server("myServer")
rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = config.toolMaven // Tool name from Jenkins configuration
rtMaven.deployer releaseRepo: "libs-release-local", snapshotRepo: "libs-snapshot-local", server: server
rtMaven.resolver releaseRepo: "libs-release", snapshotRepo: "libs-snapshot", server: server
rtMaven.deployer.deployArtifacts = false // Disable artifacts deployment during Maven run
if (config.includeFilterPattern) {
rtMaven.deployer.artifactDeploymentPatterns.addInclude(config.includeFilterPattern)
}
buildInfo = Artifactory.newBuildInfo()
buildInfo.name = "myBuild"
buildInfo.env.capture = true
My declarative code currently looks like this:
rtMavenResolver (
id: "resolver-id",
serverId: "myServer",
releaseRepo: "libs-release",
snapshotRepo: "libs-snapshot"
)
rtMavenDeployer (
id: "deployer-id",
serverId: "myServer",
releaseRepo: "libs-release-local",
snapshotRepo: "libs-snapshot-local"
)
rtBuildInfo (
captureEnv: true,
buildName: "myBuild"
)
//... mvn clean install
rtPublishBuildInfo (
serverId: "myServer"
)
Very simple once you know how (Not documented at the time of writing):
rtMavenDeployer (
id: "deployer-id",
serverId: "myServer",
releaseRepo: "libs-release-local",
snapshotRepo: "libs-snapshot-local",
includePatterns: ["frog*"]
)