diff --git a/ci/snapshot-publish/Jenkinsfile b/ci/snapshot-publish/Jenkinsfile new file mode 100644 index 00000000..67d2558b --- /dev/null +++ b/ci/snapshot-publish/Jenkinsfile @@ -0,0 +1,37 @@ +/* + * Jakarta Validation API + * + * License: Apache License, Version 2.0 + * See the license.txt file in the root directory or . + */ + +// Avoid running the pipeline on branch indexing +if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) { + print "INFO: Build skipped due to trigger being Branch Indexing" + currentBuild.result = 'NOT_BUILT' + return +} + +pipeline { + tools { + jdk 'openjdk-jdk25-latest' + } + options { + // Wait for 1h before publishing snapshots, in case there's more commits. + quietPeriod 3600 + // In any case, never publish snapshots more than once per hour. + rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true]) + + buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3')) + disableConcurrentBuilds(abortPrevious: false) + } + stages { + stage('Publish Snapshot to Maven Central') { + steps { + script { + sh "mvn clean deploy" + } + } + } + } +} diff --git a/pom.xml b/pom.xml index a27cbec9..01b618be 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.eclipse.ee4j project - 1.0.9 + 2.0.0-SNAPSHOT jakarta.validation @@ -106,6 +106,23 @@ false + + + central-snapshots + Maven Central Snapshots + https://central.sonatype.com/repository/maven-snapshots/ + default + + false + never + + + true + always + + + + org.testng