Skip to content

Commit

Permalink
Release to OSSRH
Browse files Browse the repository at this point in the history
  • Loading branch information
tristantarrant committed Sep 29, 2022
1 parent 1a30379 commit 8a27768
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 84 deletions.
19 changes: 1 addition & 18 deletions Jenkinsfile-release
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,9 @@ pipeline {
}
}

stage('Create Staging repository') {
steps {
// Create a staging repository on Nexus
script {
STAGING_REPO_ID = sh(returnStdout: true, script: "$MAVEN_HOME/bin/mvn -B -V org.sonatype.plugins:nexus-staging-maven-plugin:rc-open -pl .|grep 'Opened '|grep -oE '[^ ]+\$'").trim()
}
echo "Staging repository: $STAGING_REPO_ID"
}
}

stage('Deploy') {
steps {
sh "$MAVEN_HOME/bin/mvn -B -V -Pdistribution -DskipTests clean deploy -DstagingRepositoryId=$STAGING_REPO_ID -Dinfinispan.brand.version=${version}"
}
}

stage('Close Staging repository') {
steps {
// This ensures that Nexus validates the repository for correctness
sh "$MAVEN_HOME/bin/mvn -B -V org.sonatype.plugins:nexus-staging-maven-plugin:rc-close -pl . -DstagingRepositoryId=$STAGING_REPO_ID"
sh "$MAVEN_HOME/bin/mvn -B -V -Pcommunity-release -Pdistribution -DskipTests clean deploy -Dinfinispan.brand.version=${version}"
}
}

Expand Down
90 changes: 67 additions & 23 deletions build-configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@
</notifiers>
</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>
<modules>
<module>bom</module>
Expand All @@ -99,15 +97,16 @@
<infinispan.base.version>11.0</infinispan.base.version>
<infinispan.module.slot>${infinispan.module.slot.prefix}-${infinispan.base.version}</infinispan.module.slot>
<infinispan.core.schema.version>${infinispan.base.version}</infinispan.core.schema.version>
<infinispan.gpg.key>9E31AB27445478DB</infinispan.gpg.key>
<wildfly.brand.name>WildFly</wildfly.brand.name>
<wildfly.brand.prefix>wildfly</wildfly.brand.prefix>

<!-- jboss repository urls -->
<jboss.releases.repo.id>jboss-releases-repository</jboss.releases.repo.id>
<jboss.releases.nexus.url>https://repository.jboss.org/nexus</jboss.releases.nexus.url>
<jboss.releases.repo.url>${jboss.releases.nexus.url}/service/local/staging/deploy/maven2/</jboss.releases.repo.url>
<jboss.snapshots.repo.id>jboss-snapshots-repository</jboss.snapshots.repo.id>
<jboss.snapshots.repo.url>${jboss.releases.nexus.url}/content/repositories/snapshots/</jboss.snapshots.repo.url>
<!-- 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>

<!-- === Application Server Configuration === -->

Expand Down Expand Up @@ -195,6 +194,7 @@
<version.rxjava>3.0.4</version.rxjava>
<version.smallrye-config>1.6.2</version.smallrye-config>
<version.smallrye-metrics>2.4.0</version.smallrye-metrics>
<version.sonatype.nexus-staging-plugin>1.6.13</version.sonatype.nexus-staging-plugin>
<version.microprofile-config-api>1.4</version.microprofile-config-api>
<version.microprofile-metrics-api>2.3</version.microprofile-metrics-api>
<version.spring.boot>2.3.0.RELEASE</version.spring.boot>
Expand All @@ -214,7 +214,8 @@
<version.maven.antrun>3.0.0</version.maven.antrun>
<version.maven.buildhelper>3.1.0</version.maven.buildhelper>
<version.maven.bundle>4.2.1</version.maven.bundle>
<version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
<version.maven.gpg>3.0.1</version.maven.gpg>
<version.maven-compiler-plugin>3.10.1</version.maven-compiler-plugin>
<version.maven.invoker>3.2.1</version.maven.invoker>
<version.maven.jar>3.2.0</version.maven.jar>
<version.maven.javadoc>3.2.0</version.maven.javadoc>
Expand All @@ -237,7 +238,57 @@
<org.infinispan.attachServerZip>false</org.infinispan.attachServerZip>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${version.sonatype.nexus-staging-plugin}</version>
<configuration>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingDescription>${infinispan.brand.name} ${project.version} release</stagingDescription>
<nexusUrl>${maven.releases.nexus.url}</nexusUrl>
<serverId>${maven.releases.repo.id}</serverId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${version.maven.gpg}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${infinispan.gpg.key}</keyname>
<passphraseServerId>${infinispan.gpg.key}</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<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>

<profile>
<!-- nexus-staging-maven-plugin blocks maven-deploy-plugin -->
Expand All @@ -250,14 +301,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<configuration>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<nexusUrl>${jboss.releases.nexus.url}</nexusUrl>
<serverId>${jboss.releases.repo.id}</serverId>
<stagingProfileId>2161b7b8da0080</stagingProfileId>
<stagingRepositoryId>${stagingRepositoryId}</stagingRepositoryId>
</configuration>
<extensions>false</extensions>
</plugin>
</plugins>
</build>
Expand Down
45 changes: 2 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@
</notifier>
</notifiers>
</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>
</snapshotRepository>
</distributionManagement>
<modules>
<module>build-configuration</module>
<module>checkstyle</module>
Expand Down Expand Up @@ -1843,8 +1831,9 @@
<version>2.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.5</version>
<version>1.13.0</version>
<configuration>
<tag>${project.version}</tag>
</configuration>
Expand All @@ -1858,19 +1847,6 @@
<processAllModules>true</processAllModules>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<configuration>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingDescription>${infinispan.brand.name} ${project.version} release</stagingDescription>
<nexusUrl>${jboss.releases.nexus.url}</nexusUrl>
<serverId>${jboss.releases.repo.id}</serverId>
<stagingProfileId>2161b7b8da0080</stagingProfileId>
<stagingRepositoryId>${stagingRepositoryId}</stagingRepositoryId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand Down Expand Up @@ -2398,23 +2374,6 @@

<profiles>

<profile>
<!-- nexus-staging-maven-plugin blocks maven-deploy-plugin -->
<id>nexus-staging</id>
<activation>
<property><name>!skipNexusStaging</name></property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>m2e</id>
<activation>
Expand Down

0 comments on commit 8a27768

Please sign in to comment.