Skip to content

Commit bde60c0

Browse files
committed
build: added jreleaser plugin to Maven pom.xml
Also updated the RELEASE.md docs and extended the jreleaser.yml config
1 parent 8bf8c11 commit bde60c0

File tree

3 files changed

+93
-32
lines changed

3 files changed

+93
-32
lines changed

RELEASE.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11

2-
Use the following to test an incremental release + deploy:
2+
# Release instructions
33

4-
```
5-
mvn -B release:clean release:prepare -DdryRun=true
6-
```
7-
8-
If everything seems successful the following will actual perform a deploy:
9-
10-
```
11-
mvn -B release:clean release:prepare release:perform
12-
```
13-
14-
_WARNING: Make sure **JAVA_HOME** is set or the release will fail!_
4+
Use the following create a release and deploy:
155

16-
If something went wrong you can roll back the release using:
6+
## Step 1 - Building, staging and assembling
177

18-
```
19-
mvn release:rollback
8+
```bash
9+
./mvnw clean deploy jreleaser:assemble -Prelease
2010
```
2111

22-
Use this command to set a specific version:
12+
## Step 2 - Do a dry-run of the full release
2313

24-
```
25-
mvn -B release:update-versions -DdevelopmentVersion=1.2.3-SNAPSHOT
14+
```bash
15+
./mvnw jreleaser:full-release -Djreleaser.dry.run
2616
```
2717

28-
A manual deploy can be done like this:
18+
## Step 3 - Perform the full release
2919

30-
```
31-
mvn clean deploy -P release
20+
```bash
21+
./mvnw jreleaser:full-release
3222
```

jreleaser.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated with JReleaser 1.14.0-SNAPSHOT at 2024-07-02T18:57:13.31908+02:00
22
project:
33
name: jpm
4-
version: 0.1-SNAPSHOT
54
description: Java Package Manager
65
longDescription: |
76
A simple command line tool, taking inspiration from Node's npm, to manage Maven dependencies for Java projects
@@ -37,6 +36,17 @@ assemble:
3736
jars:
3837
- pattern: 'target/binary/lib/*.jar'
3938

39+
deploy:
40+
maven:
41+
nexus2:
42+
maven-central:
43+
active: RELEASE
44+
url: https://s01.oss.sonatype.org/service/local
45+
closeRepository: true
46+
releaseRepository: true
47+
stagingRepositories:
48+
- target/staging-deploy
49+
4050
release:
4151
github:
4252
owner: codejive

pom.xml

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,60 @@
7474
</dependencies>
7575

7676
<build>
77+
<pluginManagement>
78+
<plugins>
79+
<plugin>
80+
<groupId>com.diffplug.spotless</groupId>
81+
<artifactId>spotless-maven-plugin</artifactId>
82+
<version>${version.spotless}</version>
83+
</plugin>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-compiler-plugin</artifactId>
87+
<version>3.13.0</version>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-jar-plugin</artifactId>
92+
<version>3.4.2</version>
93+
</plugin>
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-shade-plugin</artifactId>
97+
<version>3.6.0</version>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.codehaus.mojo</groupId>
101+
<artifactId>appassembler-maven-plugin</artifactId>
102+
<version>2.1.0</version>
103+
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-source-plugin</artifactId>
107+
<version>3.3.1</version>
108+
</plugin>
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-javadoc-plugin</artifactId>
112+
<version>3.7.0</version>
113+
</plugin>
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-gpg-plugin</artifactId>
117+
<version>3.2.4</version>
118+
</plugin>
119+
<plugin>
120+
<groupId>org.jreleaser</groupId>
121+
<artifactId>jreleaser-maven-plugin</artifactId>
122+
<version>1.13.1</version>
123+
<inherited>false</inherited>
124+
</plugin>
125+
</plugins>
126+
</pluginManagement>
77127
<plugins>
78128
<plugin>
79129
<groupId>com.diffplug.spotless</groupId>
80130
<artifactId>spotless-maven-plugin</artifactId>
81-
<version>${version.spotless}</version>
82131
<configuration>
83132
<formats>
84133
<format>
@@ -145,7 +194,6 @@
145194
<plugin>
146195
<groupId>org.apache.maven.plugins</groupId>
147196
<artifactId>maven-jar-plugin</artifactId>
148-
<version>3.4.2</version>
149197
<configuration>
150198
<archive>
151199
<manifest>
@@ -157,7 +205,6 @@
157205
<plugin>
158206
<groupId>org.apache.maven.plugins</groupId>
159207
<artifactId>maven-shade-plugin</artifactId>
160-
<version>3.6.0</version>
161208
<executions>
162209
<execution>
163210
<id>cli</id>
@@ -204,7 +251,6 @@
204251
<plugin>
205252
<groupId>org.codehaus.mojo</groupId>
206253
<artifactId>appassembler-maven-plugin</artifactId>
207-
<version>2.1.0</version>
208254
<configuration>
209255
<assembleDirectory>${project.build.directory}/binary</assembleDirectory>
210256
<repositoryLayout>flat</repositoryLayout>
@@ -226,44 +272,59 @@
226272
</execution>
227273
</executions>
228274
</plugin>
275+
<plugin>
276+
<groupId>org.jreleaser</groupId>
277+
<artifactId>jreleaser-maven-plugin</artifactId>
278+
<inherited>false</inherited>
279+
<configuration>
280+
<configFile>${project.basedir}/jreleaser.yml</configFile>
281+
</configuration>
282+
</plugin>
229283
</plugins>
230284
</build>
231285

232286
<profiles>
233287
<profile>
234288
<id>release</id>
289+
<properties>
290+
<altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
291+
</properties>
235292
<build>
293+
<defaultGoal>deploy</defaultGoal>
236294
<plugins>
237295
<plugin>
238296
<groupId>org.apache.maven.plugins</groupId>
239297
<artifactId>maven-source-plugin</artifactId>
240-
<version>3.3.1</version>
241298
<executions>
242299
<execution>
243300
<id>attach-sources</id>
244301
<goals>
245-
<goal>jar-no-fork</goal>
302+
<goal>jar</goal>
246303
</goals>
304+
<configuration>
305+
<attach>true</attach>
306+
</configuration>
247307
</execution>
248308
</executions>
249309
</plugin>
250310
<plugin>
251311
<groupId>org.apache.maven.plugins</groupId>
252312
<artifactId>maven-javadoc-plugin</artifactId>
253-
<version>3.7.0</version>
254313
<executions>
255314
<execution>
256315
<id>attach-javadocs</id>
257316
<goals>
258317
<goal>jar</goal>
259318
</goals>
319+
<configuration>
320+
<attach>true</attach>
321+
</configuration>
260322
</execution>
261323
</executions>
262324
</plugin>
263-
<plugin>
325+
<!--plugin>
264326
<groupId>org.apache.maven.plugins</groupId>
265327
<artifactId>maven-gpg-plugin</artifactId>
266-
<version>3.2.4</version>
267328
<executions>
268329
<execution>
269330
<id>sign-artifacts</id>
@@ -273,7 +334,7 @@
273334
</goals>
274335
</execution>
275336
</executions>
276-
</plugin>
337+
</plugin-->
277338
</plugins>
278339
</build>
279340
</profile>

0 commit comments

Comments
 (0)