Skip to content

Commit ff24e41

Browse files
authored
Add JReleaser plugin and publication profile for Maven Central releases (#276)
The JReleaser-based release workflows require: - jreleaser-maven-plugin in pluginManagement and plugins - publication profile for staging deploy with javadoc and source JARs Backported from master to enable Maven Central publishing on 1.x.
1 parent ebd662f commit ff24e41

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

pom.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
109109
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
110110

111+
<jreleaser-maven-plugin.version>1.23.0</jreleaser-maven-plugin.version>
111112
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
112113

113114
<!-- empty argLine property, the value is set up by Jacoco during unit tests execution -->
@@ -220,6 +221,40 @@
220221
<artifactId>maven-deploy-plugin</artifactId>
221222
<version>${maven-deploy-plugin.version}</version>
222223
</plugin>
224+
<plugin>
225+
<groupId>org.jreleaser</groupId>
226+
<artifactId>jreleaser-maven-plugin</artifactId>
227+
<version>${jreleaser-maven-plugin.version}</version>
228+
<configuration>
229+
<jreleaser>
230+
<signing>
231+
<active>ALWAYS</active>
232+
<armored>true</armored>
233+
</signing>
234+
<deploy>
235+
<maven>
236+
<mavenCentral>
237+
<sonatype>
238+
<active>RELEASE</active>
239+
<url>https://central.sonatype.com/api/v1/publisher</url>
240+
<stagingRepositories>target/staging-deploy</stagingRepositories>
241+
</sonatype>
242+
</mavenCentral>
243+
<nexus2>
244+
<maven-central>
245+
<active>SNAPSHOT</active>
246+
<url>https://ossrh-staging-api.central.sonatype.com/service/local</url>
247+
<snapshotUrl>https://central.sonatype.com/repository/maven-snapshots</snapshotUrl>
248+
<applyMavenCentralRules>true</applyMavenCentralRules>
249+
<snapshotSupported>true</snapshotSupported>
250+
<stagingRepositories>target/staging-deploy</stagingRepositories>
251+
</maven-central>
252+
</nexus2>
253+
</maven>
254+
</deploy>
255+
</jreleaser>
256+
</configuration>
257+
</plugin>
223258
</plugins>
224259
</pluginManagement>
225260
<plugins>
@@ -589,6 +624,10 @@
589624
</execution>
590625
</executions>
591626
</plugin>
627+
<plugin>
628+
<groupId>org.jreleaser</groupId>
629+
<artifactId>jreleaser-maven-plugin</artifactId>
630+
</plugin>
592631
</plugins>
593632
</build>
594633

@@ -716,6 +755,50 @@
716755
</build>
717756
</profile>
718757

758+
<profile>
759+
<id>publication</id>
760+
<properties>
761+
<altDeploymentRepository>local::default::file:./target/staging-deploy</altDeploymentRepository>
762+
</properties>
763+
<build>
764+
<defaultGoal>deploy</defaultGoal>
765+
<plugins>
766+
<plugin>
767+
<groupId>org.apache.maven.plugins</groupId>
768+
<artifactId>maven-javadoc-plugin</artifactId>
769+
<version>${maven-javadoc-plugin.version}</version>
770+
<executions>
771+
<execution>
772+
<id>attach-javadocs</id>
773+
<goals>
774+
<goal>jar</goal>
775+
</goals>
776+
<configuration>
777+
<attach>true</attach>
778+
</configuration>
779+
</execution>
780+
</executions>
781+
</plugin>
782+
<plugin>
783+
<groupId>org.apache.maven.plugins</groupId>
784+
<artifactId>maven-source-plugin</artifactId>
785+
<version>${maven-source-plugin.version}</version>
786+
<executions>
787+
<execution>
788+
<id>attach-sources</id>
789+
<goals>
790+
<goal>jar</goal>
791+
</goals>
792+
<configuration>
793+
<attach>true</attach>
794+
</configuration>
795+
</execution>
796+
</executions>
797+
</plugin>
798+
</plugins>
799+
</build>
800+
</profile>
801+
719802
</profiles>
720803

721804
</project>

0 commit comments

Comments
 (0)