Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ci/snapshot-publish/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Jakarta Validation API
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/

// 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"
}
}
}
}
}
19 changes: 18 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
<version>1.0.9</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<groupId>jakarta.validation</groupId>
Expand Down Expand Up @@ -106,6 +106,23 @@
<enforcer.skip>false</enforcer.skip>
</properties>

<repositories>
<repository>
<id>central-snapshots</id>
<name>Maven Central Snapshots</name>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
Expand Down