Skip to content

Commit 053235b

Browse files
committed
Configure Maven release profile and automatic deployment
1 parent 132f42e commit 053235b

File tree

2 files changed

+58
-56
lines changed

2 files changed

+58
-56
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
3939
git config --global author.name "${GITHUB_ACTOR}"
4040
- name: Release
41-
run: ./mvnw -B -Prelease-sign-artifacts -DreleaseVersion=${{ github.event.inputs.releaseVersion }} release:prepare release:perform
41+
run: ./mvnw -B -Prelease -DreleaseVersion=${{ github.event.inputs.releaseVersion }} release:prepare release:perform
4242
- name: Rollback on failure
4343
if: ${{ failure() }}
4444
run: |
45-
./mvnw -B release:rollback -Prelease-sign-artifacts -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}}
45+
./mvnw -B release:rollback -Prelease -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}}
4646
echo "You may need to manually delete the GitHub tag, if it was created."

pom.xml

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
4-
<parent>
5-
<groupId>org.sonatype.oss</groupId>
6-
<artifactId>oss-parent</artifactId>
7-
<version>7</version>
8-
</parent>
9-
103
<modules>
114
<module>core</module>
125
<module>cli</module>
@@ -168,19 +161,12 @@
168161
</properties>
169162
</profile>
170163
<profile>
171-
<id>release-sign-artifacts</id>
172-
<activation>
173-
<property>
174-
<name>performRelease</name>
175-
<value>true</value>
176-
</property>
177-
</activation>
164+
<id>release</id>
178165
<build>
179166
<plugins>
180167
<plugin>
181168
<groupId>org.apache.maven.plugins</groupId>
182169
<artifactId>maven-gpg-plugin</artifactId>
183-
<version>1.6</version>
184170
<configuration>
185171
<gpgArguments>
186172
<arg>--pinentry-mode</arg>
@@ -197,6 +183,55 @@
197183
</execution>
198184
</executions>
199185
</plugin>
186+
<plugin>
187+
<groupId>org.sonatype.plugins</groupId>
188+
<artifactId>nexus-staging-maven-plugin</artifactId>
189+
<configuration>
190+
<serverId>sonatype-nexus-staging</serverId>
191+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
192+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
193+
</configuration>
194+
<executions>
195+
<execution>
196+
<id>nexus-deploy</id>
197+
<phase>deploy</phase>
198+
<goals>
199+
<goal>deploy</goal>
200+
</goals>
201+
</execution>
202+
</executions>
203+
</plugin>
204+
<plugin>
205+
<groupId>org.apache.maven.plugins</groupId>
206+
<artifactId>maven-source-plugin</artifactId>
207+
<executions>
208+
<execution>
209+
<phase>package</phase>
210+
<goals>
211+
<goal>jar-no-fork</goal>
212+
</goals>
213+
</execution>
214+
</executions>
215+
</plugin>
216+
<plugin>
217+
<groupId>org.apache.maven.plugins</groupId>
218+
<artifactId>maven-javadoc-plugin</artifactId>
219+
<configuration>
220+
<quiet>true</quiet>
221+
<nonavbar>true</nonavbar>
222+
<notree>true</notree>
223+
<nocomment>true</nocomment>
224+
<nohelp>true</nohelp>
225+
</configuration>
226+
<executions>
227+
<execution>
228+
<id>attach-javadocs</id>
229+
<goals>
230+
<goal>jar</goal>
231+
</goals>
232+
</execution>
233+
</executions>
234+
</plugin>
200235
</plugins>
201236
</build>
202237
</profile>
@@ -254,25 +289,15 @@
254289
<artifactId>maven-shade-plugin</artifactId>
255290
<version>3.2.4</version>
256291
</plugin>
292+
<plugin>
293+
<groupId>org.sonatype.plugins</groupId>
294+
<artifactId>nexus-staging-maven-plugin</artifactId>
295+
<version>1.6.8</version>
296+
<extensions>true</extensions>
297+
</plugin>
257298
</plugins>
258299
</pluginManagement>
259300
<plugins>
260-
<plugin>
261-
<groupId>org.apache.maven.plugins</groupId>
262-
<artifactId>maven-compiler-plugin</artifactId>
263-
</plugin>
264-
<plugin>
265-
<groupId>org.apache.maven.plugins</groupId>
266-
<artifactId>maven-source-plugin</artifactId>
267-
<executions>
268-
<execution>
269-
<phase>package</phase>
270-
<goals>
271-
<goal>jar-no-fork</goal>
272-
</goals>
273-
</execution>
274-
</executions>
275-
</plugin>
276301
<plugin>
277302
<groupId>org.apache.maven.plugins</groupId>
278303
<artifactId>maven-release-plugin</artifactId>
@@ -282,29 +307,6 @@
282307
<releaseProfiles>release</releaseProfiles>
283308
</configuration>
284309
</plugin>
285-
<plugin>
286-
<groupId>org.apache.maven.plugins</groupId>
287-
<artifactId>maven-javadoc-plugin</artifactId>
288-
<configuration>
289-
<quiet>true</quiet>
290-
<nonavbar>true</nonavbar>
291-
<notree>true</notree>
292-
<nocomment>true</nocomment>
293-
<nohelp>true</nohelp>
294-
</configuration>
295-
<executions>
296-
<execution>
297-
<id>attach-javadocs</id>
298-
<goals>
299-
<goal>jar</goal>
300-
</goals>
301-
</execution>
302-
</executions>
303-
</plugin>
304-
<plugin>
305-
<groupId>org.apache.maven.plugins</groupId>
306-
<artifactId>maven-surefire-plugin</artifactId>
307-
</plugin>
308310
<plugin>
309311
<groupId>com.coveo</groupId>
310312
<artifactId>fmt-maven-plugin</artifactId>

0 commit comments

Comments
 (0)