-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
452 lines (421 loc) · 17.4 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
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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<?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>
<!-- ====================================================================== -->
<!-- PROPERTIES -->
<!-- ====================================================================== -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Java version -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- REVISION -->
<!-- Update revision:
> mvn -Drevision={new revision} clean package
-->
<revision>R01F-VERSION</revision>
<!-- Dependencies versions -->
<guice.version>4.2.1</guice.version> <!-- TODO 4.2.2 version exists BUT somehow it cannot be loaded! -->
</properties>
<!-- ====================================================================== -->
<!-- ARTIFACT -->
<!-- ====================================================================== -->
<groupId>r01.r01f.businessservices</groupId>
<name>r01fBusinessServices</name>
<artifactId>r01fBusinessServices</artifactId>
<version>${revision}</version>
<packaging>pom</packaging> <!-- it's a parent project -->
<!-- ====================================================================== -->
<!-- MODULES -->
<!-- ====================================================================== -->
<modules>
<module>r01fBusinessServicesClasses</module>
<module>r01fBusinessServicesClient</module>
<module>r01fBusinessServicesCore</module>
<module>r01fBusinessServicesGuice</module>
<module>r01fBusinessServicesTestClasses</module>
</modules>
<!-- ====================================================================== -->
<!-- DEPENDENCIES -->
<!-- ====================================================================== -->
<dependencies>
<!-- ///////////////////////////////////////// -->
<!-- R01F -->
<!-- ///////////////////////////////////////// -->
<dependency>
<groupId>r01.r01f.base</groupId>
<artifactId>r01fBaseClasses</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<!-- ====================================================================== -->
<!-- PLUGINS -->
<!-- ====================================================================== -->
<build>
<!--
Default plugin config
BEWARE!! In [eclipse] ensure this config is set:
[window] > [preferences] > [Maven] > [Errors/Wranings] > [Plugin execution NOT covered by lifecycle configuration] >>> se to WARNING
-->
<pluginManagement>
<plugins>
<!--
[0] - CLEAN: https://maven.apache.org/plugins/maven-clean-plugin/
The Clean Plugin is used when you want to remove files generated at build-time in a project's ServiceCatalog.
-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!--
PHASES: see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging
[1] - process-resources
process-test-resources
[2] - test-compile
[3] - test
[4] - package
[5] - install
[6] - deploy
-->
<!--
[1] - RESOURCES: https://maven.apache.org/plugins/maven-resources-plugin/
The Resources Plugin handles the copying of project resources to the output directory
There are two different kinds of resources: main resources and test resources
-->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!--
[2] - COMPILE: https://maven.apache.org/plugins/maven-compiler-plugin/
The Compiler Plugin is used to compile the sources of your project.
-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!--
[3] - TEST: https://maven.apache.org/surefire/maven-surefire-plugin/
The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<!--
[4] - PACKAGE: https://maven.apache.org/plugins/maven-war-plugin/
The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive
-->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version> <!-- version 3.1.2 is problematic in older versions of eclipse (upgrade the maven conector from https://download.eclipse.org/m2e-wtp/releases/1.4/) -->
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<!--
[5] - INSTALL: https://maven.apache.org/plugins/maven-install-plugin/
The Install Plugin is used during the install phase to add artifact(s) to the local repository
-->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<!--
[6] - DEPLOY: https://maven.apache.org/plugins/maven-deploy-plugin/usage.html
-->
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Add the [resources] dir to the compile & package phase -->
<!-- https://www.mojohaus.org/build-helper-maven-plugin/usage.html -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/resources</source>
<source>src/test/resources</source>
<source>src/main/config</source>
<source>src/main/aspect</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Automatic replacement of a parent [version] variable in child modules -->
<!-- https://www.mojohaus.org/flatten-maven-plugin/usage.html -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<!-- <flattenMode>resolveCiFriendliesOnly</flattenMode> -->
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
Version plugin (not used; replaced by revision + flatten)
> mvn versions:set -DnewVersion={new version}
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<!--
ECLIPSE ========================================================
This plugin has NO effects in maven build:
m2e ONLY runs some 'standard' goals of the maven pom.xml since the aim of m2e is NOT to be a complete CI tool
... in order to include 'non-standard' goals in m2e execution and avoid [plugin execution not covered by the eclipse m2e plugin project build lifecycle mapping]
the 'non-standard' plugin MUST be explicitly included in m2e execution
m2eclipse executes the default phases and goals of maven into the internal Eclipse build workflow.
IDE usecase is editing sources and running tests, NOT the complete Maven build,
... so for example, plugin goals that publish build results to a remote repository can be ignored
without any adverse side effects, while java source code compilation is strictly necessary
m2eclipse requires EXPLICIT INSTRUCTIONS about what to do with all Maven plugins bound to “interesting” phases
of a project build lifecycle
These INSTRUCTUONS are called [project build lifecycle mapping] or simply [lifecycle mapping]
because they define how m2e maps information from pom.xml file to:
- Eclipse workspace project configuration
- behaviour during Eclipse workspace build
Project build [lifecycle mapping] can be configured in:
[1] - The pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
... put here the lifecycle metadata ...
</lifecycleMappingMetadata>
</configuraction>
</plugin>
</plugins>
</pluginManagement>
</build>
[2] - The [lifecycle-mapping-metadata.xml] file (see [window] > [preferences] > [maven] > [lifecycle mappings])
Just create a file called [lifecycle-mapping-metadata.xml] at the location configured at [window] > [preferences] > [maven] > [lifecycle mappings]
The content of this file is the same as the content of the <configuration> above:
<lifecycleMappingMetadata>
... put here the lifecycle metadata ...
</lifecycleMappingMetadata>
The first approach does NOT require any [eclipse]-specific config but 'polutes' the pom.xml with
CI non-required config
See: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html
https://stackoverflow.com/questions/30063357/how-can-i-map-maven-lifecycle-phases-not-covered-by-the-eclipse-m2e-plugin
-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- flatten plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<versionRange>[1.1.0,)</versionRange>
<goals>
<goal>flatten</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<!--
Plugins to be run by default
-->
<plugins>
<!--
Run the [flatten] plugin by default
if the [flatten] plugin is NOT run by default the GOAL MUST be run instead:
mvn clean flatten:flatten install
If none of the above is done, the folder containing the artifact will be
incorrectly named ${revision} instead of the revision number
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins>
<!--
The Resources Plugin handles the copying of project resources to the output directory
-->
<resources>
<resource>
<directory>src/main/config</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<!-- ====================================================================== -->
<!-- REPOSITORIES -->
<!-- ====================================================================== -->
<!--
IMPORTANT: IZENPE's root certificate MUST be installed at the jdk's [cert-store]
[1] - Using a [web browser], goto to the repository url
https://bin1.alm02.itbatera.euskadi.eus/repository/maven-public-releases/
[2] - Check the certificate chain:
[Izenpe.com]
|- EAEKo Herri Administrazioen CA - CA AAPP Vascas (2)
|- builds1.alm02.itbatera.euskadi.eus
Download the ROOT certificate as CER files (only the [root] certificate is really needed)
[3] - When in [eclipse], guess what is the eclipse workspace active jdk
[window] > [preferences] > [java] > [installed JREs]
[3] - Open a system console
a) goto to the [jdk] bin directory
$> cd {jdk_root}/bin
b) run the [keytool]
- If JRE <= 8
$>keytool -keystore {jdk_root}\jre\lib\security\cacerts -import -file {develop_root}\projects\fabric\r01f\docs\eclipse\maven\certs\izenpe.com.cer -alias izenpe_root -storepass changeit
- If JRE > 8
$>keytool -keystore {jdk_root}\lib\security\cacerts -import -file {develop_root}\projects\fabric\r01f\docs\eclipse\maven\certs\izenpe.com.cer -alias izenpe_root -storepass changeit
BEWARE!!!
- DO NOT delete the jdk's origina keystore at {jdk_root}\jre\lib\security\cacerts since it contains the
most common certificate-authorities public root certificates
-->
<repositories>
<repository>
<id>EJIE</id>
<name>EJIE Public Releases</name>
<url>https://bin1.alm02.itbatera.euskadi.eus/repository/maven-public-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<layout>default</layout>
</repository>
</repositories>
<!-- ====================================================================== -->
<!-- ARTIFACT DISTRIBUTION -->
<!-- ====================================================================== -->
<distributionManagement>
<repository>
<id>maven-public-releases</id>
<name>maven-public-releases</name>
<layout>default</layout>
<url>https://bin1.alm02.itbatera.euskadi.eus/repository/maven-public-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>maven-snapshots</name>
<layout>default</layout>
<url>https://bin1.alm02.itbatera.euskadi.eus/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- ====================================================================== -->
<!-- PROFILES -->
<!-- ====================================================================== -->
<!--
The application config has TWO levels:
- public: anyone can see it > Project (artifact) name: [{appCode}Config]
- private by EJIE environment: only authorized people can access it > Project (artifact) name: [{appCode}ConfigByEnv]
The aim of the existence of TWO separate projects for configs is that anyone at the outside (not from EJIE) do NOT have the need of
private EJIE-dependent projects like `[{appCode}ConfigByEnv]` so just cloning the 'public' part of the code & config is
usually enough to run the app
... at the same time, inside EJIE, a `[{appCode}ConfigByEnv]` is used to store the environment-dependent or 'secret' config
At runtime, while loading the config:
- if an R01_ENV system property is set, config from the 'public' project (artifact) [{appCode}Config]
is MIXED with config from the 'private' project (artifcat) [{appCode}ConfigByEnv]
- if NO R01_ENV system property is set only config from the 'public' project (artifact) [{appCode}Config] is used
A Maven PROFILE is used so the 'private' project `[{appCode}ConfigByEnv]` is only required if `PROFILE=env_profile`
If a Maven PROFILE is **NOT** set (the default _'public'_ case), the `[{appCode}ConfigByEnv]` dependency is NOT required
This way, the EJIE private config is 'secret' while anyone from the 'outside' (public) still can build the app without the EJIE private config artifact dependency
-->
<profiles>
<!-- Used when a profile is NOT set [mvn clean install] (public) -->
<profile>
<id>default_profile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- Used when setting a profile like [mvn clean install -Penv_profile] (ejie internal) -->
<!-- place here any env-dependent artifact -->
<!--
<profile>
<id>env_profile</id>
<dependencies>
<dependency>
<groupId>...the group id...</groupId>
<artifactId>...the artifact id...</artifactId>
<version>version</version>
</dependency>
</dependencies>
</profile>
-->
</profiles>
</project>