1 | $JOMC: BUILDING.txt 5091 2016-04-04 15:40:17Z schulte $ |
---|
2 | |
---|
3 | Build Requirements |
---|
4 | ------------------ |
---|
5 | |
---|
6 | In order to build JOMC artifacts, the following software needs to be |
---|
7 | installed. |
---|
8 | |
---|
9 | o Java Development Kit (JDK), Version 1.7 or higher |
---|
10 | |
---|
11 | Please consult the operating system documentation on how to install a Java |
---|
12 | development kit. |
---|
13 | |
---|
14 | o Apache Maven 3.x |
---|
15 | |
---|
16 | The following link redirects to the official Apache Maven website. |
---|
17 | http://www.jomc.org/redirect/mng |
---|
18 | |
---|
19 | In order to build JOMC release artifacts, the following software needs to be |
---|
20 | installed in addition. |
---|
21 | |
---|
22 | o GnuPG |
---|
23 | |
---|
24 | The following link redirects to the official GnuPG website. |
---|
25 | http://www.jomc.org/redirect/gpg |
---|
26 | |
---|
27 | |
---|
28 | Building Snapshot Artifacts |
---|
29 | --------------------------- |
---|
30 | |
---|
31 | For building snapshot artifacts, no further setup is required. |
---|
32 | |
---|
33 | Artifact sources are compiled by executing: |
---|
34 | cmd> mvn compile |
---|
35 | |
---|
36 | Unit tests are run by executing: |
---|
37 | cmd> mvn test |
---|
38 | |
---|
39 | Snapshot archives are created by executing: |
---|
40 | cmd> mvn package |
---|
41 | |
---|
42 | Snapshot artifacts are installed by executing: |
---|
43 | cmd> mvn install |
---|
44 | |
---|
45 | The project site is build by executing: |
---|
46 | cmd> mvn site |
---|
47 | |
---|
48 | Building Release Artifacts |
---|
49 | -------------------------- |
---|
50 | |
---|
51 | For building release artifacts, various properties need to be set. This is |
---|
52 | done by using the '-D' command line option. To minimize the number of '-D' |
---|
53 | options, a profile can be added to the local Maven settings.xml file. The |
---|
54 | following link redirects to the official Maven settings reference. |
---|
55 | http://www.jomc.org/redirect/msettings |
---|
56 | |
---|
57 | <profile> |
---|
58 | <id>jomc.org</id> |
---|
59 | <properties> |
---|
60 | <!-- --> |
---|
61 | <!-- --> |
---|
62 | <!-- Source Code Management System Properties --> |
---|
63 | <!-- ======================================== --> |
---|
64 | <!-- --> |
---|
65 | <!-- The 'jomc.scm.username' property must be set to the name of the --> |
---|
66 | <!-- user used for authentication with the project source code --> |
---|
67 | <!-- management system. --> |
---|
68 | <!-- --> |
---|
69 | <jomc.scm.username>Username</jomc.scm.username> |
---|
70 | <!-- --> |
---|
71 | <!-- The 'jomc.scm.password' property must be set to the password --> |
---|
72 | <!-- used for authentication with the project source code management --> |
---|
73 | <!-- system. To avoid storing cleartext passwords, this property --> |
---|
74 | <!-- should be set using the '-D' command line option. --> |
---|
75 | <!-- --> |
---|
76 | <jomc.scm.password>Password</jomc.scm.password> |
---|
77 | <!-- --> |
---|
78 | <!-- --> |
---|
79 | <!-- Issue Management System Properties --> |
---|
80 | <!-- ======================================== --> |
---|
81 | <!-- --> |
---|
82 | <!-- The 'jomc.trac.username' property must be set to the name of --> |
---|
83 | <!-- the user used for authentication with the project issue --> |
---|
84 | <!-- management system. --> |
---|
85 | <!-- --> |
---|
86 | <jomc.trac.username>Username</jomc.trac.username> |
---|
87 | <!-- --> |
---|
88 | <!-- The 'jomc.trac.password' property must be set to the password --> |
---|
89 | <!-- used for authentication with the project issue management --> |
---|
90 | <!-- system. To avoid storing cleartext passwords, this property --> |
---|
91 | <!-- should be set using the '-D' command line option. --> |
---|
92 | <!-- --> |
---|
93 | <jomc.trac.password>Password</jomc.trac.password> |
---|
94 | <!-- --> |
---|
95 | <!-- --> |
---|
96 | <!-- Code Signing Properties --> |
---|
97 | <!-- ======================= --> |
---|
98 | <!-- --> |
---|
99 | <!-- Code signing is backed by the 'maven-jarsigner-plugin'. --> |
---|
100 | <!-- The following link redirects to the official documentation of --> |
---|
101 | <!-- that plugin. http://www.jomc.org/redirect/mjarsigner --> |
---|
102 | <!-- --> |
---|
103 | <!-- --> |
---|
104 | <!-- The 'jarsigner.keystore' property may be set to the location of --> |
---|
105 | <!-- the keystore used for signing Java archives. --> |
---|
106 | <!-- --> |
---|
107 | <!-- <jarsigner.keystore>Location</jarsigner.keystore> --> |
---|
108 | <!-- --> |
---|
109 | <!-- The 'jarsigner.storepass' property may be set to the password --> |
---|
110 | <!-- of the keystore used for signing Java archives. To avoid --> |
---|
111 | <!-- storing cleartext passwords, this property should be set using --> |
---|
112 | <!-- the '-D' command line option. --> |
---|
113 | <!-- --> |
---|
114 | <!-- <jarsigner.storepass>Password</jarsigner.storepass> --> |
---|
115 | <!-- --> |
---|
116 | <!-- The 'jarsigner.alias' property must be set to the alias of the --> |
---|
117 | <!-- certificate used for signing Java archives. --> |
---|
118 | <!-- --> |
---|
119 | <jarsigner.alias>Alias</jarsigner.alias> |
---|
120 | <!-- --> |
---|
121 | <!-- The 'jarsigner.keypass' property may be set to the password of --> |
---|
122 | <!-- the certificate used for signing Java archives. To avoid --> |
---|
123 | <!-- storing cleartext passwords, this property should be set using --> |
---|
124 | <!-- the '-D' command line option. --> |
---|
125 | <!-- --> |
---|
126 | <!-- <jarsigner.keypass>Password</jarsigner.keypass> --> |
---|
127 | <!-- --> |
---|
128 | <!-- The 'jarsigner.tsa' property must be set to an URL of a --> |
---|
129 | <!-- timestamping authority used for signing Java archives. --> |
---|
130 | <!-- --> |
---|
131 | <!-- For example: --> |
---|
132 | <!-- https://timestamp.geotrust.com/tsa --> |
---|
133 | <!-- --> |
---|
134 | <jarsigner.tsa>URL</jarsigner.tsa> |
---|
135 | <!-- --> |
---|
136 | <!-- --> |
---|
137 | <!-- Artifact Signing Properties --> |
---|
138 | <!-- =========================== --> |
---|
139 | <!-- --> |
---|
140 | <!-- Artifact signing is backed by the 'maven-gpg-plugin'. --> |
---|
141 | <!-- The following link redirects to the official documentation of --> |
---|
142 | <!-- that plugin. http://www.jomc.org/redirect/mgpg --> |
---|
143 | <!-- --> |
---|
144 | <!-- --> |
---|
145 | <!-- The 'gpg.keyname' property may be set to the name of the GPG --> |
---|
146 | <!-- key used for signing artifacts. --> |
---|
147 | <!-- --> |
---|
148 | <!-- <gpg.keyname>Key</gpg.keyname> --> |
---|
149 | <!-- --> |
---|
150 | <!-- The 'gpg.passphrase' property may be set to the passphrase of --> |
---|
151 | <!-- the GPG key used for signing artifacts. To avoid storing --> |
---|
152 | <!-- cleartext passwords, this property should be set using the '-D' --> |
---|
153 | <!-- command line option. --> |
---|
154 | <!-- --> |
---|
155 | <!-- <gpg.passphrase>Passphrase</gpg.passphrase> --> |
---|
156 | <!-- --> |
---|
157 | <!-- --> |
---|
158 | </properties> |
---|
159 | </profile> |
---|
160 | |
---|
161 | That profile is enabled by using the '-P' command line option. |
---|
162 | |
---|
163 | Release archives are created by executing: |
---|
164 | cmd> mvn -Pjomc-release,jomc.org verify |
---|
165 | |
---|
166 | Release artifacts are installed by executing: |
---|
167 | cmd> mvn -Pjomc-release,jomc.org install |
---|
168 | |
---|
169 | |
---|
170 | Deploying Snapshot Artifacts |
---|
171 | ---------------------------- |
---|
172 | |
---|
173 | Snapshot artifacts are deployed by executing: |
---|
174 | cmd> mvn deploy |
---|
175 | |
---|
176 | For this to work, a server definition needs to be specified in the local |
---|
177 | Maven settings.xml file used for authentication with the remote snapshot |
---|
178 | repository. |
---|
179 | |
---|
180 | <server> |
---|
181 | <id>sonatype-nexus-snapshots</id> |
---|
182 | <username>OSS Username</username> |
---|
183 | <password>OSS Password</password> |
---|
184 | </server> |
---|
185 | |
---|
186 | Optionally, to use deployed snapshot artifacts, a corresponding profile |
---|
187 | may be added to the local Maven settings.xml file. |
---|
188 | |
---|
189 | <profile> |
---|
190 | <id>oss.sonatype.org</id> |
---|
191 | <repositories> |
---|
192 | <repository> |
---|
193 | <id>sonatype-nexus-snapshots</id> |
---|
194 | <name>Sonatype Nexus Snapshots</name> |
---|
195 | <url>https://oss.sonatype.org/content/repositories/snapshots</url> |
---|
196 | <releases> |
---|
197 | <enabled>false</enabled> |
---|
198 | </releases> |
---|
199 | <snapshots> |
---|
200 | <enabled>true</enabled> |
---|
201 | </snapshots> |
---|
202 | </repository> |
---|
203 | </repositories> |
---|
204 | <pluginRepositories> |
---|
205 | <pluginRepository> |
---|
206 | <id>sonatype-nexus-snapshots</id> |
---|
207 | <name>Sonatype Nexus Snapshots</name> |
---|
208 | <url>https://oss.sonatype.org/content/repositories/snapshots</url> |
---|
209 | <releases> |
---|
210 | <enabled>false</enabled> |
---|
211 | </releases> |
---|
212 | <snapshots> |
---|
213 | <enabled>true</enabled> |
---|
214 | </snapshots> |
---|
215 | </pluginRepository> |
---|
216 | </pluginRepositories> |
---|
217 | </profile> |
---|
218 | |
---|
219 | That profile is enabled by using the '-P' command line option. |
---|
220 | For example: |
---|
221 | |
---|
222 | cmd> mvn -Poss.sonatype.org compile |
---|
223 | cmd> mvn -Poss.sonatype.org test |
---|
224 | cmd> mvn -Poss.sonatype.org package |
---|
225 | cmd> mvn -Poss.sonatype.org install |
---|
226 | cmd> mvn -Poss.sonatype.org site |
---|
227 | |
---|
228 | The following link redirects to the repository hosting service used by this |
---|
229 | project. http://www.jomc.org/redirect/oss |
---|
230 | |
---|
231 | Deploying Release Artifacts |
---|
232 | --------------------------- |
---|
233 | |
---|
234 | For deploying releases, various server definitions need to be specified in |
---|
235 | the local Maven settings.xml file used for authentication with the remote |
---|
236 | staging repository, the remote file release server and the remote XML schema |
---|
237 | server. |
---|
238 | |
---|
239 | <server> |
---|
240 | <id>sonatype-nexus-staging</id> |
---|
241 | <username>OSS Username</username> |
---|
242 | <password>OSS Password</password> |
---|
243 | </server> |
---|
244 | |
---|
245 | <server> |
---|
246 | <id>frs.jomc.org</id> |
---|
247 | <username>FRS Username</username> |
---|
248 | <password>FRS Password</password> |
---|
249 | </server> |
---|
250 | |
---|
251 | <server> |
---|
252 | <id>xml.jomc.org</id> |
---|
253 | <username>XML Username</username> |
---|
254 | <password>XML Password</password> |
---|
255 | </server> |
---|
256 | |
---|
257 | Release artifacts are deployed by executing: |
---|
258 | cmd> mvn -Pjomc-release,jomc.org deploy |
---|
259 | |
---|
260 | Project Site Deployment |
---|
261 | ----------------------- |
---|
262 | |
---|
263 | For deploying the project web site, a server definition needs to be |
---|
264 | specified in the local Maven settings.xml file used for authentication with |
---|
265 | the project web server. |
---|
266 | |
---|
267 | <server> |
---|
268 | <id>www.jomc.org</id> |
---|
269 | <username>Username</username> |
---|
270 | <password>Password</password> |
---|
271 | </server> |
---|
272 | |
---|
273 | The project web site is deployed by executing: |
---|
274 | cmd> mvn site-deploy |
---|
275 | |
---|
276 | Releasing Artifacts |
---|
277 | ------------------- |
---|
278 | |
---|
279 | The release process is backed by the 'maven-release-plugin'. The following |
---|
280 | link redirects to the official documentation of that plugin. |
---|
281 | http://www.jomc.org/redirect/mrelease |
---|
282 | |
---|
283 | Releases are prepared by executing: |
---|
284 | cmd> mvn release:prepare -Pjomc.org |
---|
285 | |
---|
286 | Releases are performed by executing: |
---|
287 | cmd> mvn release:perform -Pjomc-release,jomc.org |
---|