This repository was archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpom.xml
More file actions
430 lines (402 loc) · 20.3 KB
/
Copy pathpom.xml
File metadata and controls
430 lines (402 loc) · 20.3 KB
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-settings-decoder</artifactId>
<description>maven settings.xml decoder for gradle</description>
<groupId>cn.home1.tools</groupId>
<name>maven-settings-decoder</name>
<packaging>pom</packaging>
<url>https://github.com/ci-and-cd/maven-settings-decoder</url>
<version>1.2.0-SNAPSHOT</version>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.org/ci-and-cd/maven-settings-decoder</url>
</ciManagement>
<developers>
<developer>
<name>Haolun Zhang</name>
<url>https://github.com/chshawkn</url>
</developer>
</developers>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/ci-and-cd/maven-settings-decoder/issues</url>
</issueManagement>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>maven-settings-decoder-cipher</module>
<module>maven-settings-decoder-cli</module>
<module>maven-settings-decoder-core</module>
</modules>
<scm>
<connection>scm:git:https://github.com/ci-and-cd/maven-settings-decoder.git</connection>
<developerConnection>scm:git:ssh://git@github.com/ci-and-cd/maven-settings-decoder.git</developerConnection>
<url>https://github.com/ci-and-cd/maven-settings-decoder</url>
<tag>HEAD</tag>
</scm>
<properties>
<java.version>1.8</java.version>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<version.maven-assembly-plugin>3.0.0</version.maven-assembly-plugin>
<version.maven-compiler-plugin>3.5.1</version.maven-compiler-plugin>
<version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
<version.maven-jar-plugin>3.0.2</version.maven-jar-plugin>
<version.maven-shade-plugin>2.4.3</version.maven-shade-plugin>
<version.gitflow-maven-plugin>1.11.0</version.gitflow-maven-plugin>
<version.commons-cli>1.3.1</version.commons-cli>
<version.junit>4.12</version.junit>
<version.logback>1.2.3</version.logback>
<version.maven-settings>3.3.9</version.maven-settings>
<version.plexus-cipher>1.7</version.plexus-cipher>
</properties>
<build>
<plugins>
<!-- see: https://github.com/KimJejun/gitflow-maven-plugin -->
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<configuration>
<tychoBuild>false</tychoBuild>
<installProject>false</installProject>
<verbose>false</verbose>
<gitFlowConfig>
<productionBranch>master</productionBranch>
<developmentBranch>develop</developmentBranch>
<featureBranchPrefix>feature/</featureBranchPrefix>
<releaseBranchPrefix>release/</releaseBranchPrefix>
<hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
<supportBranchPrefix>support/</supportBranchPrefix>
<versionTagPrefix>v</versionTagPrefix>
</gitFlowConfig>
<commitMessages>
<featureStartMessage>updating versions for feature branch</featureStartMessage>
<featureFinishMessage>updating versions for development branch</featureFinishMessage>
<hotfixStartMessage>updating versions for hotfix</hotfixStartMessage>
<hotfixFinishMessage>updating for next development version</hotfixFinishMessage>
<releaseStartMessage>updating versions for release</releaseStartMessage>
<releaseFinishMessage>updating for next development version</releaseFinishMessage>
<tagHotfixMessage>tagging hotfix</tagHotfixMessage>
<tagReleaseMessage>tagging release</tagReleaseMessage>
</commitMessages>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerVersion>${java.version}</compilerVersion>
<encoding>${project.build.sourceEncoding}</encoding>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>${version.gitflow-maven-plugin}</version>
</plugin>
<plugin><artifactId>maven-assembly-plugin</artifactId><version>${version.maven-assembly-plugin}</version></plugin>
<plugin><artifactId>maven-compiler-plugin</artifactId><version>${version.maven-compiler-plugin}</version></plugin>
<plugin><artifactId>maven-gpg-plugin</artifactId><version>${version.maven-gpg-plugin}</version></plugin>
<plugin><artifactId>maven-jar-plugin</artifactId><version>${version.maven-jar-plugin}</version></plugin>
<plugin><artifactId>maven-shade-plugin</artifactId><version>${version.maven-shade-plugin}</version></plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><scope>test</scope></dependency>
<dependency><groupId>junit</groupId><artifactId>junit</artifactId><scope>test</scope></dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency><groupId>${project.groupId}</groupId><artifactId>maven-settings-decoder-cipher</artifactId><version>${project.version}</version></dependency>
<dependency><groupId>${project.groupId}</groupId><artifactId>maven-settings-decoder-core</artifactId><version>${project.version}</version></dependency>
<dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>${version.logback}</version></dependency>
<dependency><groupId>commons-cli</groupId><artifactId>commons-cli</artifactId><version>${version.commons-cli}</version></dependency>
<dependency><groupId>org.apache.maven</groupId><artifactId>maven-settings</artifactId><version>${version.maven-settings}</version></dependency>
<dependency><groupId>org.sonatype.plexus</groupId><artifactId>plexus-cipher</artifactId><version>${version.plexus-cipher}</version></dependency>
<dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>${version.junit}</version></dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>gpg2-arguments</id>
<activation><property><name>gpg.loopback</name><value>true</value></property></activation>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<gpgArguments>
<gpgArgument>--use-agent</gpgArgument>
<gpgArgument>--pinentry-mode</gpgArgument>
<gpgArgument>loopback</gpgArgument>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gpg-for-travis-and-maven-central</id>
<activation><property><name>gpg.executable</name></property></activation>
<properties>
<!-- Do not set gpg.executable here -->
<!--<gpg.executable>gpg</gpg.executable>-->
<gpg.keyname>${env.CI_OPT_GPG_KEYNAME}</gpg.keyname>
<gpg.passphrase>${env.CI_OPT_GPG_PASSPHRASE}</gpg.passphrase>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution><id>sign-artifacts</id><phase>verify</phase><goals><goal>sign</goal></goals></execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release-and-publish-to-ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
<property><name>!release-and-publish-to-github</name></property>
</activation>
<distributionManagement>
<repository>
<id>ossrh-nexus2-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh-nexus2-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<failOnError>false</failOnError>
<charset>${project.build.sourceEncoding}</charset>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate</goal>
</goals>
<phase>site</phase>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<!--https://maven.apache.org/plugins/maven-source-plugin/test-jar-no-fork-mojo.html-->
<!--jar会执行此插件绑定的maven默认生命周期:@Execute( phase = LifecyclePhase.GENERATE_SOURCES )
,这里使用jar-no-fork避免这个问题 -->
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh-nexus2-snapshots</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!--
<![CDATA[
Usage:
1. Execute following command and put output (encrypted master password) into ~/.m2/settings-security.xml
mvn -emp ${master_password}
2. mvn -ep ${your_github_password}
3. Put following content into ~/.m2/settings.xml
<server>
<id>github-${your_github_username}</id>
<username>${your_github_account_email}</username>
<password>{encrypted_your_github_password}</password>
</server>
4. To publish a release
Following actions can be automated using the maven-release-plugin
1. Commit any modifications
2. Remove the -SNAPSHOT from the version number
3. Deploy the module to the release-repository
4. Tag the source code with the version number
5. Increment the version number and append -SNAPSHOT
see: https://dzone.com/articles/configuring-the-maven-release-plugin-to-skip-tests
mvn -DpreparationGoals=compile -Darguments="" release:prepare
mvn -Darguments="-DskipTests" release:perform
Delete tag on release failed, see: https://www.abeautifulsite.net/how-to-delete-a-tag-on-github
Example:
git tag -d ${tag}
git push origin :${tag}
5. To publish a snapshot
mvn -Dmaven.test.skip=true clean package deploy
Note:
Create a empty mvn-repo branch on github
git checkout \-\-orphan mvn-repo
git rm -rf .
git commit \-\-allow-empty -m "root commit"
git push origin mvn-repo
Create gpg key on mac
brew install gpg
execute gpg \-\-list-keys to create trustdb.gpg
gpg \-\-list-keys
see: http://lijingsen.cn/2015/09/03/how-to-generate-gpg-signature-with-maven/
see: https://www.gnupg.org/documentation/manuals/gnupg-devel/Unattended-GPG-key-generation.html
cat >maven_gpg_key_with_default_algorithms <<EOF
%echo Generating a default key
Key-Type: default
Subkey-Type: default
Name-Real: home1.cn
Name-Comment: with passphrase
Name-Email: opensource@home1.cn
Expire-Date: 0
Passphrase: passphrase
%pubring maven_gpg_key.pub
%secring maven_gpg_key.sec
# Do a commit here, so that we can later print "done" :-)
%commit
%echo done
EOF gpg2 \-\-batch \-\-gen-key maven_gpg_key_with_default_algorithms gpg \-\-allow-secret-key-import \-\-import ./maven_gpg_key.sec gpg \-\-import ./maven_gpg_key.pub # List public keys gpg \-\-list-keys # List private keys gpg \-\-list-secret-keys Put following content into ~/.m2/settings.xml To get gpg.keyname: gpg \-\-list-secret-keys | grep -E '^sec' | awk '{print $2}' | awk -F/ '{print $2}'
gpg \-\-list-keys | grep -E '^pub' | awk '{print $2}' | awk -F/ '{print $2}'
<servers>
<server>
<id>gpg.passphrase</id>
<passphrase>${gpg.passphrase}</passphrase>
</server>
</servers>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.keyname>${gpg.keyname}</gpg.keyname>
</properties>
</profile>
]]>
-->
<profile>
<id>release-and-publish-to-github</id>
<activation>
<activeByDefault>false</activeByDefault>
<property><name>release-and-publish-to-github</name></property>
</activation>
<properties>
<!-- github server corresponds to entry in ~/.m2/settings.xml -->
<github.global.server>github</github.global.server>
</properties>
<!-- see: http://stackoverflow.com/questions/14013644/hosting-a-maven-repository-on-github -->
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.5</version>
</dependency>
</dependencies>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<goals>deploy</goals>
<useReleaseProfile>false</useReleaseProfile>
<arguments>${arguments}</arguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo
</altDeploymentRepository>
</configuration>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<!-- git commit message -->
<message>Maven artifacts for ${project.version}</message>
<merge>true</merge>
<!-- disable webpage processing -->
<noJekyll>true</noJekyll>
<!-- matches distribution management repository url above -->
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<!-- remote branch name -->
<branch>refs/heads/mvn-repo</branch>
<includes>
<include>**/*</include>
</includes>
<!-- github repo name -->
<repositoryName>${project.artifactId}</repositoryName>
<!-- github username -->
<repositoryOwner>ci-and-cd</repositoryOwner>
</configuration>
<executions>
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>