Skip to content

Commit

Permalink
OSSRH-82400 Publish to Sonatype Open Source Project Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
pruivo authored and tristantarrant committed Aug 29, 2022
1 parent 5381e23 commit 0c520a4
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 76 deletions.
78 changes: 78 additions & 0 deletions Jenkinsfile-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env groovy

pipeline {
agent {
label 'slave-group-release'
}

parameters {
string(name: 'version', defaultValue: '0.0.0.Qualifier', description: 'Release version')
string(name: 'nextVersion', defaultValue: '', description: 'Next release (blank to stay on current SNAPSHOT)')
gitParameter(name: 'branch', defaultValue: 'origin/master', branchFilter: 'origin/(.*)', type: 'PT_BRANCH', description: 'Branch to release from')
}

options {
timeout(time: 1, unit: 'HOURS')
timestamps()
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '61'))
}

stages {
stage('Prepare') {
steps {
script {
env.MAVEN_HOME = tool('Maven')
env.MAVEN_OPTS = "-Xmx1g -XX:+HeapDumpOnOutOfMemoryError"
env.JAVA_HOME = tool('JDK 11')
}

sh returnStdout: true, script: 'cleanup.sh'
}
}

stage('Checkout') {
steps {
checkout scm
}
}

stage('Version') {
steps {
sh "$MAVEN_HOME/bin/mvn -B -V versions:set -DnewVersion=${version} -DprocessAllModules=true"
sh "$MAVEN_HOME/bin/mvn -B -V versions:set-property -Dproperty=version.infinispan -DnewVersion=${version}"
}
}

stage('Deploy') {
steps {
sh "$MAVEN_HOME/bin/mvn -B -V -Pcommunity-release -DskipTests clean deploy -DstagingRepositoryId=$STAGING_REPO_ID"
}
}

stage('Tag') {
steps {
// Commit and tag once everything is good
sh "$MAVEN_HOME/bin/mvn -B -V scm:checkin -Dmessage=\"Releasing version ${version}\" -DpushChanges=false"
sh "$MAVEN_HOME/bin/mvn -B -V scm:tag -Dtag=${version}"
}
}

stage('Next version') {
when {
expression { params.nextVersion != '' }
}
steps {
sh "$MAVEN_HOME/bin/mvn -B -V versions:set -DnewVersion=${nextVersion} -DprocessAllModules=true"
sh "$MAVEN_HOME/bin/mvn -B -V versions:set-property -Dproperty=version.infinispan -DnewVersion=${nextVersion}"
sh "$MAVEN_HOME/bin/mvn -B -V -Dmessage='next version ${nextVersion}' -DscmVersion=${branch} -DscmVersionType=branch scm:checkin"
}
}
}

post {
always {
// Clean
sh 'git clean -fdx -e "*.hprof" || echo "git clean failed, exit code $?"'
}
}
}
23 changes: 0 additions & 23 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,6 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
<doclint>none</doclint>
<detectLinks>false</detectLinks>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
96 changes: 66 additions & 30 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,14 @@
</ciManagement>

<distributionManagement>
<repository>
<id>${jboss.releases.repo.id}</id>
<name>JBoss Release Repository</name>
<url>${jboss.releases.repo.url}</url>
</repository>

<snapshotRepository>
<id>${jboss.snapshots.repo.id}</id>
<name>JBoss Snapshot Repository</name>
<url>${jboss.snapshots.repo.url}</url>
<id>${maven.snapshots.repo.id}</id>
<url>${maven.snapshots.repo.url}</url>
</snapshotRepository>
<repository>
<id>${maven.releases.repo.id}</id>
<url>${maven.releases.repo.url}</url>
</repository>
</distributionManagement>

<properties>
Expand All @@ -115,7 +112,7 @@

<!-- plugins version -->
<version.maven.nexus-staging>1.6.12</version.maven.nexus-staging>
<version.maven.animalsniffer>1.18</version.maven.animalsniffer>
<version.maven.gpg>3.0.1</version.maven.gpg>

<version.protobuf>3.19.4</version.protobuf>
<version.javax.annotation-api>1.3.2</version.javax.annotation-api>
Expand All @@ -134,6 +131,15 @@
<version.commons-cli>1.5.0</version.commons-cli>
<version.jackson>2.13.2</version.jackson>
<version.auto-service>1.0.1</version.auto-service>

<!-- maven repository urls -->
<maven.releases.nexus.url>https://s01.oss.sonatype.org/</maven.releases.nexus.url>
<maven.releases.repo.id>ossrh</maven.releases.repo.id>
<maven.releases.repo.url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</maven.releases.repo.url>
<maven.snapshots.repo.id>ossrh</maven.snapshots.repo.id>
<maven.snapshots.repo.url>https://s01.oss.sonatype.org/content/repositories/snapshots</maven.snapshots.repo.url>

<infinispan.gpg.key>9E31AB27445478DB</infinispan.gpg.key>
</properties>

<repositories>
Expand Down Expand Up @@ -359,6 +365,7 @@
<useIncrementalCompilation>false</useIncrementalCompilation>
<!-- Include method parameter debug info -->
<parameters>true</parameters>
<release>8</release>
</configuration>
</plugin>

Expand All @@ -381,44 +388,59 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>${version.maven.animalsniffer}</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
<ignores>
<ignore>sun.misc.Unsafe</ignore>
</ignores>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven.gpg}</version>
<executions>
<execution>
<phase>process-classes</phase>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${infinispan.gpg.key}</keyname>
<passphraseServerId>${infinispan.gpg.key}</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
<doclint>none</doclint>
<detectLinks>false</detectLinks>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<!-- See configuration details at http://books.sonatype.com/nexus-book/reference/staging-deployment.html -->
<nexusUrl>${jboss.releases.nexus.url}</nexusUrl>
<serverId>${jboss.releases.repo.id}</serverId>
<stagingProfileId>2161b7b8da0080</stagingProfileId>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingDescription>Infinispan Protostream ${project.version} release</stagingDescription>
<nexusUrl>${maven.releases.nexus.url}</nexusUrl>
<serverId>${maven.releases.repo.id}</serverId>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -472,5 +494,19 @@
</plugins>
</build>
</profile>
<profile>
<id>community-release</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
23 changes: 0 additions & 23 deletions processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,6 @@
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
<doclint>none</doclint>
<detectLinks>false</detectLinks>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down

0 comments on commit 0c520a4

Please sign in to comment.