2021-11-13 14:52:39 -05:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
tools {
|
|
|
|
maven 'Maven 3'
|
|
|
|
jdk 'Java 8'
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
buildDiscarder(logRotator(artifactNumToKeepStr: '20'))
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage ('Build') {
|
|
|
|
steps {
|
|
|
|
sh 'mvn clean package'
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
success {
|
|
|
|
archiveArtifacts artifacts: 'target/*.jar', excludes: 'target/*-sources.jar', fingerprint: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage ('Deploy') {
|
|
|
|
when {
|
|
|
|
branch "master"
|
|
|
|
}
|
|
|
|
|
|
|
|
steps {
|
|
|
|
rtMavenDeployer(
|
|
|
|
id: "maven-deployer",
|
|
|
|
serverId: "opencollab-artifactory",
|
|
|
|
releaseRepo: "maven-releases",
|
|
|
|
snapshotRepo: "maven-snapshots"
|
|
|
|
)
|
|
|
|
rtMavenResolver(
|
|
|
|
id: "maven-resolver",
|
|
|
|
serverId: "opencollab-artifactory",
|
|
|
|
releaseRepo: "maven-deploy-release",
|
|
|
|
snapshotRepo: "maven-deploy-snapshot"
|
|
|
|
)
|
|
|
|
rtMavenRun(
|
|
|
|
pom: 'pom.xml',
|
2022-04-12 10:55:20 -04:00
|
|
|
goals: 'javadoc:javadoc javadoc:jar source:jar install -DskipTests',
|
2021-11-13 14:52:39 -05:00
|
|
|
deployerId: "maven-deployer",
|
|
|
|
resolverId: "maven-resolver"
|
|
|
|
)
|
|
|
|
rtPublishBuildInfo(
|
|
|
|
serverId: "opencollab-artifactory"
|
|
|
|
)
|
2022-04-12 10:55:20 -04:00
|
|
|
step([$class: 'JavadocArchiver', javadocDir: 'target/site/apidocs', keepAll: false])
|
2021-11-13 14:52:39 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-12 10:55:20 -04:00
|
|
|
}
|