Skip to content

Commit 5782dd4

Browse files
committed
Add ability to test build without signing and add build instructions to the README.md
See https://stackoverflow.com/a/14869692/7518605 Use mvn -DperformRelease=true ... if you need to sign your build
1 parent 0c8a4e2 commit 5782dd4

File tree

2 files changed

+50
-14
lines changed

2 files changed

+50
-14
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,23 @@ Further reading:
1313
* [About Kaitai Struct](http://kaitai.io/)
1414
* [About API implemented in this library](http://doc.kaitai.io/stream_api.html)
1515
* [Java-specific notes](http://doc.kaitai.io/lang_java.html)
16+
17+
# Build
18+
To build library run the following command:
19+
20+
```console
21+
mvn install
22+
```
23+
24+
# Release
25+
To make a release ensure that you have:
26+
27+
- a [gpg](https://gnupg.org/) installed
28+
- a [configured](https://maven.apache.org/plugins/maven-gpg-plugin/usage.html) gpg signing key
29+
- pass `-DperformRelease=true` argument to the maven command invocation:
30+
31+
```console
32+
mvn -DperformRelease=true deploy
33+
```
34+
35+
See also http://doc.kaitai.io/developers.html#java.

pom.xml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,36 @@
4242
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4343
</properties>
4444

45+
<profiles>
46+
<profile>
47+
<id>release-sign-artifacts</id>
48+
<activation>
49+
<property>
50+
<name>performRelease</name>
51+
<value>true</value>
52+
</property>
53+
</activation>
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-gpg-plugin</artifactId>
59+
<version>3.0.1</version>
60+
<executions>
61+
<execution>
62+
<id>sign-artifacts</id>
63+
<phase>verify</phase>
64+
<goals>
65+
<goal>sign</goal>
66+
</goals>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
</plugins>
71+
</build>
72+
</profile>
73+
</profiles>
74+
4575
<build>
4676
<plugins>
4777
<plugin>
@@ -97,20 +127,6 @@
97127
</tags>
98128
</configuration>
99129
</plugin>
100-
<plugin>
101-
<groupId>org.apache.maven.plugins</groupId>
102-
<artifactId>maven-gpg-plugin</artifactId>
103-
<version>3.0.1</version>
104-
<executions>
105-
<execution>
106-
<id>sign-artifacts</id>
107-
<phase>verify</phase>
108-
<goals>
109-
<goal>sign</goal>
110-
</goals>
111-
</execution>
112-
</executions>
113-
</plugin>
114130
<plugin>
115131
<groupId>org.apache.maven.plugins</groupId>
116132
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)