-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
316 lines (316 loc) · 14.5 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modules>
<module>docker</module>
<module>testcontainers</module>
<module>distributed-lock-mongodb</module>
<module>distributed-lock-mongodb-spring-boot-starter</module>
<module>distributed-lock-mongodb-spring-boot-starter-example</module>
</modules>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.daggerok</groupId>
<artifactId>distributed-lock-mongodb-parent</artifactId>
<version>3.3.3-SNAPSHOT</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Distributed Lock based on MongoDB and Spring Boot 3.x</description>
<url>https://github.com/daggerok/distributed-lock-mongodb-spring-boot-starter</url>
<developers>
<developer>
<name>Maksim Kostromin</name>
<email>[email protected]</email>
<organization>Sets of open source Maksim Kostromin aka daggerok projects</organization>
<organizationUrl>https://github.com/daggerok/</organizationUrl>
</developer>
</developers>
<organization>
<name>Maksim Kostromin aka daggerok open source projects sets</name>
<url>https://github.com/daggerok/</url>
</organization>
<licenses>
<license>
<name>MIT License</name>
<distribution>repo</distribution>
<!-- <url>https://opensource.org/licenses/MIT</url> -->
<url>https://github.com/daggerok/distributed-lock-mongodb-spring-boot-starter/blob/master/LICENSE</url>
</license>
</licenses>
<scm>
<developerConnection>scm:git:[email protected]:daggerok/distributed-lock-mongodb-spring-boot-starter.git</developerConnection>
<connection>scm:git:https://github.com/daggerok/distributed-lock-mongodb-spring-boot-starter.git</connection>
<url>https://github.com/daggerok/distributed-lock-mongodb-spring-boot-starter/tree/master</url>
<!-- <tag>master</tag> -->
<tag>HEAD</tag>
</scm>
<properties>
<java.version>17</java.version>
<vavr.version>0.10.4</vavr.version>
<testcontainers.version>1.20.1</testcontainers.version>
<docker-maven-plugin.version>0.45.0</docker-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
<gpg.skip>true</gpg.skip>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<!--suppress VulnerableLibrariesLocal: checkmarx vulnerability report. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean verify</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
<failOnError>false</failOnError>
<failOnWarnings>false</failOnWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<configuration>
<skip>${gpg.skip}</skip>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<id>sign-artifacts</id>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<minmemory>128m</minmemory>
<maxmemory>512</maxmemory>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>read gpg.passphrase system property</id>
<!--
This profile will pick `gpg.passphrase` java system property to configure maven-gpg-plugin passphrase implicitly
./mvnw -Dgpg.passphrase=...
-->
<activation>
<property>
<name>gpg.passphrase</name>
</property>
</activation>
<properties>
<gpg.skip>false</gpg.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<passphrase>${gpg.passphrase}</passphrase>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>read GPG_PASSPHRASE environment variable</id>
<!--
This profile will pick `GPG_PASSPHRASE` environment variable to configure maven-gpg-plugin passphrase implicitly
GPG_PASSPHRASE=... ./mvnw ...
-->
<activation>
<property>
<name>env.GPG_PASSPHRASE</name>
</property>
</activation>
<properties>
<gpg.skip>false</gpg.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>central-release</id>
<!--
This profile mainly must be used to release project artifacts to central maven repository
Prerequisites are:
- gpg install, private key with passphrase generated
- maven pom.xml required plugins added and configured with proper profiles
Workflow:
- Let's say your version is x.y.z-SNAPSHOT
./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout
- Then you can deploy snapshot version to maven central just like so:
GPG_PASSPHRASE=... ./mvnw -P central-release clean deploy
- When testing of deployed x.y.z-SNAPSHOT is done, you can change version to released: x.y.z-SNAPSHOT -> x.y.z
./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion}
- If something goes wrong, you can simply revert last change with help of previously created pom.xml.versionsBackup files:
./mvnw build-helper:parse-version versions:revert
- Otherwise commit, this will remove all generated pom.xml.versionsBackup files:
./mvnw build-helper:parse-version versions:commit
- Let's commit release version with these commands:
VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
git add . ; git commit -am "Release $VERSION version manually." ; git push origin master
- And release x.y.z version artifacts to maven central:
GPG_PASSPHRASE=... ./mvnw -P central-release clean deploy
- It's time to create and push GitHub tag released version:
git tag $VERSION ; git push origin $VERSION
- Finally create next SNAPSHOT version for future development iteration: x.y.z -> x.y.(z+1)-SNAPSHOT
./mvnw build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
./mvnw build-helper:parse-version versions:commit
VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
git add . ; git commit -am "Start next $VERSION development iteration." ; git push origin master
see: https://central.sonatype.org/publish/publish-maven/#nexus-staging-maven-plugin-for-deployment-and-release
-->
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<defaultGoal>clean deploy</defaultGoal>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<!--<nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<tags>
<localUsername>${env.USER}</localUsername>
<javaVersion>${java.version}</javaVersion>
</tags>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>