pom.xml 23.2 KB
Newer Older
LAVENIER's avatar
LAVENIER committed
1
2
3
4
5
<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>

  <parent>
    <groupId>net.sumaris</groupId>
6
    <artifactId>sumaris-pod</artifactId>
LAVENIER's avatar
LAVENIER committed
7
    <version>1.10.2-SNAPSHOT</version>
LAVENIER's avatar
LAVENIER committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  </parent>

  <artifactId>sumaris-core</artifactId>
  <packaging>jar</packaging>
  <name>SUMARiS:: Core</name>
  <description>SUMARiS core library</description>

  <properties>
    <!-- i18n configuration -->
    <i18n.bundleOutputName>sumaris-core-i18n</i18n.bundleOutputName>
    <i18n.generateCsvFile>true</i18n.generateCsvFile>
    <i18n.bundleCsvFile>
      ${project.build.directory}/generated-sources/resources/META-INF/${i18n.bundleOutputName}.csv
    </i18n.bundleCsvFile>
    <config.i18nBundleName>${i18n.bundleOutputName}</config.i18nBundleName>

    <hibernate.generated.cfg.dir>
      ${project.build.directory}/generated-sources/resources
    </hibernate.generated.cfg.dir>
    <hibernate.generated.cfg.path>${hibernate.generated.cfg.dir}/hibernate.cfg.xml</hibernate.generated.cfg.path>
    <hibernate.generated.properties.path>${hibernate.generated.cfg.dir}/hibernate.properties</hibernate.generated.properties.path>

LAVENIER's avatar
LAVENIER committed
30
31
32
33
34
    <persistence.xml.generated.dir>
      ${project.build.directory}/generated-sources/resources/META-INF
    </persistence.xml.generated.dir>
    <persistence.xml.generated.path>${persistence.xml.generated.dir}/persistence.xml</persistence.xml.generated.path>

LAVENIER's avatar
LAVENIER committed
35
36
37
38
    <hibernate.entities.package>net.sumaris.core.model</hibernate.entities.package>

    <test>AllTests</test>

LAVENIER's avatar
LAVENIER committed
39
40
    <!-- Default datasource type -->
    <spring.datasource.platform>hsqldb</spring.datasource.platform>
LAVENIER's avatar
LAVENIER committed
41
42
43
44
45
46
47
48
49
50
  </properties>

  <dependencies>

    <!-- Project dependencies -->
    <dependency>
      <groupId>net.sumaris</groupId>
      <artifactId>sumaris-core-shared</artifactId>
      <version>${project.version}</version>
    </dependency>
LAVENIER's avatar
LAVENIER committed
51
52
53
54
55
56
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-tools</artifactId>
      <version>${hibernate-tools.version}</version>
      <scope>runtime</scope>
    </dependency>
LAVENIER's avatar
LAVENIER committed
57
58
59
60
61
62
63

    <!-- hibernate, spring... -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
64
      <groupId>org.hibernate.validator</groupId>
LAVENIER's avatar
LAVENIER committed
65
66
67
68
      <artifactId>hibernate-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
LAVENIER's avatar
LAVENIER committed
69
      <artifactId>hibernate-jcache</artifactId>
LAVENIER's avatar
LAVENIER committed
70
    </dependency>
71
72
73
74
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-spatial</artifactId>
    </dependency>
LAVENIER's avatar
LAVENIER committed
75
    <!--<dependency>
LAVENIER's avatar
LAVENIER committed
76
77
78
79
80
81
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-search-orm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-search-elasticsearch</artifactId>
LAVENIER's avatar
LAVENIER committed
82
    </dependency>-->
LAVENIER's avatar
LAVENIER committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-jpa</artifactId>
    </dependency>
    <dependency>
      <groupId>com.querydsl</groupId>
      <artifactId>querydsl-jpa</artifactId>
    </dependency>
99
100
101
102
103
104
105
106
107
108
109
110
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-broker</artifactId>
    </dependency>
LAVENIER's avatar
LAVENIER committed
111
112
113
114
115
    <dependency>
      <groupId>jakarta.jms</groupId>
      <artifactId>jakarta.jms-api</artifactId>
      <scope>compile</scope>
    </dependency>
116

LAVENIER's avatar
LAVENIER committed
117
118
119
120
121
122
123
124
125
126
127
128
129
    <!-- Nuiton-* -->
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-config</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton.i18n</groupId>
      <artifactId>nuiton-i18n</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-utils</artifactId>
    </dependency>
130
131

    <!-- Spring boot -->
LAVENIER's avatar
LAVENIER committed
132
133
134
135
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
LAVENIER's avatar
LAVENIER committed
136
137
138
139
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-cache</artifactId>
    </dependency>
LAVENIER's avatar
LAVENIER committed
140
141

    <!-- Unit test -->
142
143
144
145
146
147
    <dependency>
      <groupId>net.sumaris</groupId>
      <artifactId>sumaris-test-shared</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
LAVENIER's avatar
LAVENIER committed
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.dbunit</groupId>
      <artifactId>dbunit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
163
164
165
166
167
168
    <dependency>
      <groupId>com.mattbertolini</groupId>
      <artifactId>liquibase-slf4j</artifactId>
      <version>1.2.1</version>
      <scope>test</scope>
    </dependency>
LAVENIER's avatar
LAVENIER committed
169

170
171
172
173
174
    <dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc8</artifactId>
      <scope>test</scope>
    </dependency>
bnimajneb's avatar
bnimajneb committed
175
176


LAVENIER's avatar
LAVENIER committed
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
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>*.config</include>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.*</include>
        </includes>
      </resource>
      <resource>
        <directory>target/generated-sources/resources</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.*</include>
        </includes>
      </resource>
    </resources>

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    <testResources>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>*.config</include>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.*</include>
        </includes>
      </testResource>
    </testResources>

LAVENIER's avatar
LAVENIER committed
225
226
227
228
229
230
231
    <plugins>

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>

232
233
234
235
236
237
238
239
240
241
242
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>escape-backslashes</id>
            <phase>validate</phase>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
243
              <value>${project.build.directory}/classes</value>
244
245
246
247
248
249
250
251
252
              <regex>\\</regex>
              <replacement>/</replacement>
              <name>escapedOutputDirectory</name>
              <failIfNoMatch>false</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>

LAVENIER's avatar
LAVENIER committed
253
254
255
256
257
258
259
260
261
262
263
264
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
LAVENIER's avatar
LAVENIER committed
265
            <id>generate-reflections-xml</id>
266
            <phase>process-classes</phase>
LAVENIER's avatar
LAVENIER committed
267
268
269
270
271
272
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <scripts>
                <script><![CDATA[
273
274
                  import org.reflections.*;
                  import org.reflections.util.*;
LAVENIER's avatar
LAVENIER committed
275

276
277
278
279
280
281
                  ConfigurationBuilder builder = new ConfigurationBuilder();
                  builder.addUrls(ClasspathHelper.forPackage("${hibernate.entities.package}"));
                  builder.addUrls(ClasspathHelper.forPackage("net.sumaris.core.vo"));
                  new org.reflections.Reflections(builder)
                      .save("${escapedOutputDirectory}/META-INF/reflections/${project.artifactId}-reflections.xml")
                ]]></script>
LAVENIER's avatar
LAVENIER committed
282
283
284
285
286
287
              </scripts>
            </configuration>
          </execution>
        </executions>
      </plugin>

288
      <plugin>
LAVENIER's avatar
LAVENIER committed
289
290
291
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
292
            <id>generate-hibernate-files</id>
LAVENIER's avatar
LAVENIER committed
293
294
295
296
297
298
299
300
301
302
303
304
            <phase>process-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <taskdef resource="net/sf/antcontrib/antlib.xml">
                  <classpath refid="maven.plugin.classpath" />
                </taskdef>

                <echo level="info">Generate Hibernate files [hibernate.cfg.xml] and [hibernate.properties]</echo>
                <ant antfile="${project.basedir}/src/main/ant/hibernate.xml" target="generate-hibernate-cfg" inheritRefs="true" />
LAVENIER's avatar
LAVENIER committed
305
306
307

                <echo level="info">Generate JPA file [persistence.xml]</echo>
                <ant antfile="${project.basedir}/src/main/ant/hibernate.xml" target="generate-persistence-xml" inheritRefs="true" />
LAVENIER's avatar
LAVENIER committed
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
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>i18n-maven-plugin</artifactId>

        <executions>
          <execution>
            <id>scan-sources</id>
            <configuration>
              <entries>
                <entry>
                  <specificGoal>parserValidation</specificGoal>
                  <basedir>${maven.src.dir}/main/java/</basedir>
                  <includes>
                    <param>**/**-validation.xml</param>
                  </includes>
                </entry>
              </entries>
            </configuration>
            <goals>
              <goal>parserJava</goal>
              <goal>parserValidation</goal>
              <goal>gen</goal>
            </goals>
          </execution>
          <execution>
            <id>make-bundle</id>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>hsqldb</id>
      <activation>
        <activeByDefault>true</activeByDefault>
        <property>
LAVENIER's avatar
LAVENIER committed
355
          <name>spring.datasource.platform</name>
LAVENIER's avatar
LAVENIER committed
356
357
358
359
360
361
362
363
364
365
366
          <value>hsqldb</value>
        </property>
      </activation>

      <properties>
        <sumaris.persistence.db.directory>target/db</sumaris.persistence.db.directory>
        <sumaris.persistence.db.name>sumaris</sumaris.persistence.db.name>
        <jdbc.url>jdbc:hsqldb:file:${sumaris.persistence.db.directory}/${sumaris.persistence.db.name}</jdbc.url>
        <jdbc.driver.jar>${settings.localRepository}/org/hsqldb/hsqldb/${hsqldb.version}/hsqldb-${hsqldb.version}.jar</jdbc.driver.jar>
        <jdbc.username>sa</jdbc.username>
        <jdbc.password />
LAVENIER's avatar
LAVENIER committed
367
        <jdbc.driver>org.hsqldb.jdbc.JDBCDriver</jdbc.driver>
LAVENIER's avatar
LAVENIER committed
368
        <jdbc.schema>PUBLIC</jdbc.schema>
LAVENIER's avatar
LAVENIER committed
369
        <spring.datasource.platform>hsqldb</spring.datasource.platform>
370
        <hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.HSQLSpatialDialect</hibernate.dialect>
LAVENIER's avatar
LAVENIER committed
371
372
373
374
375
376
377
378
379
380
381
        <hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
      </properties>

      <dependencies>
        <dependency>
          <groupId>org.hsqldb</groupId>
          <artifactId>hsqldb</artifactId>
        </dependency>
      </dependencies>
    </profile>

382
383
384
385
    <profile>
      <id>h2</id>
      <activation>
        <property>
LAVENIER's avatar
LAVENIER committed
386
          <name>spring.datasource.platform</name>
387
388
389
390
391
392
393
394
395
396
397
398
399
          <value>h2</value>
        </property>
      </activation>

      <properties>
        <sumaris.persistence.db.directory>target/db</sumaris.persistence.db.directory>
        <sumaris.persistence.db.name>sumaris</sumaris.persistence.db.name>
        <jdbc.url>jdbc:h2:file:${sumaris.persistence.db.directory}/${sumaris.persistence.db.name}</jdbc.url>
        <jdbc.driver.jar>${settings.localRepository}/org/h2/h2/${h2.version}/h2-${hsqldb.version}.jar</jdbc.driver.jar>
        <jdbc.username>sa</jdbc.username>
        <jdbc.password />
        <jdbc.driver>org.h2.Driver</jdbc.driver>
        <jdbc.schema>PUBLIC</jdbc.schema>
LAVENIER's avatar
LAVENIER committed
400
        <spring.datasource.platform>h2</spring.datasource.platform>
401
402
403
404
405
406
407
408
409
410
411
412
        <hibernate.dialect>org.hibernate.spatial.dialect.h2geodb.GeoDBDialect</hibernate.dialect>
        <hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
      </properties>

      <dependencies>
        <dependency>
          <groupId>org.hsqldb</groupId>
          <artifactId>hsqldb</artifactId>
        </dependency>
      </dependencies>
    </profile>

LAVENIER's avatar
LAVENIER committed
413
414
415
416
    <profile>
      <id>oracle</id>
      <activation>
        <property>
LAVENIER's avatar
LAVENIER committed
417
          <name>spring.datasource.platform</name>
LAVENIER's avatar
LAVENIER committed
418
419
420
421
422
423
          <value>oracle</value>
        </property>
      </activation>

      <properties>
        <jdbc.url>jdbc:oracle:thin:@192.168.0.6:1521:ORCL</jdbc.url>
424
        <jdbc.driver.jar>${settings.localRepository}/com/oracle/ojdbc8/${ojdbc8.version}/ojdbc8-${ojdbc8.version}.jar</jdbc.driver.jar>
LAVENIER's avatar
LAVENIER committed
425
426
427
428
        <jdbc.username>SUMARIS_TU</jdbc.username>
        <jdbc.password>SUMARIS_TU</jdbc.password>
        <jdbc.schema>SUMARIS_TU</jdbc.schema>
        <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
LAVENIER's avatar
LAVENIER committed
429
        <spring.datasource.platform>oracle</spring.datasource.platform>
LAVENIER's avatar
LAVENIER committed
430
431
432
433
434
435
436
        <hibernate.dialect>org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect</hibernate.dialect>
        <hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
      </properties>

      <dependencies>
        <dependency>
          <groupId>com.oracle</groupId>
437
          <artifactId>ojdbc8</artifactId>
LAVENIER's avatar
LAVENIER committed
438
439
440
441
442
443
444
445
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>pgsql</id>
      <activation>
        <property>
LAVENIER's avatar
LAVENIER committed
446
          <name>spring.datasource.platform</name>
LAVENIER's avatar
LAVENIER committed
447
448
449
450
451
          <value>pgsql</value>
        </property>
      </activation>

      <properties>
COTONNEC's avatar
COTONNEC committed
452
        <jdbc.url>jdbc:postgresql://localhost:5432/sumaris-test</jdbc.url>
LAVENIER's avatar
LAVENIER committed
453
454
455
        <jdbc.driver.jar>${settings.localRepository}/org/postgresql/postgresql/${pgsql.version}/postgresql-${pgsql.version}.jar</jdbc.driver.jar>
        <jdbc.username>sumaris</jdbc.username>
        <jdbc.password>sumaris</jdbc.password>
COTONNEC's avatar
COTONNEC committed
456
        <jdbc.schema>public</jdbc.schema>
LAVENIER's avatar
LAVENIER committed
457
        <jdbc.driver>org.postgresql.Driver</jdbc.driver>
LAVENIER's avatar
LAVENIER committed
458
        <spring.datasource.platform>pgsql</spring.datasource.platform>
COTONNEC's avatar
COTONNEC committed
459
        <hibernate.dialect>org.hibernate.dialect.PostgreSQL10Dialect</hibernate.dialect>
LAVENIER's avatar
LAVENIER committed
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
        <hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
      </properties>

      <dependencies>
        <dependency>
          <groupId>org.postgresql</groupId>
          <artifactId>postgresql</artifactId>
        </dependency>
      </dependencies>
    </profile>

    <!-- To run some reports at release time -->
    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <properties>
        <!-- mandatory for hibernate tools hbm2doc -->
        <jdbc.reporting.schema>SUMARIS</jdbc.reporting.schema>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <dependencies>
LAVENIER's avatar
LAVENIER committed
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
              <!-- project dependencies -->
              <dependency>
                <groupId>net.sumaris</groupId>
                <artifactId>sumaris-core-shared</artifactId>
                <version>${project.version}</version>
                <exclusions>
                  <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                  </exclusion>
                  <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                  </exclusion>
                </exclusions>
              </dependency>
LAVENIER's avatar
LAVENIER committed
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
              <!-- need for hibernate tools -->
              <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-tools</artifactId>
                <version>${hibernate-tools.version}</version>
                <exclusions>
                  <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                  </exclusion>
                  <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                  </exclusion>
                </exclusions>
              </dependency>
              <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
              </dependency>
LAVENIER's avatar
LAVENIER committed
527
528
529
530
531
<!--              <dependency>-->
<!--                <groupId>org.hibernate</groupId>-->
<!--                <artifactId>hibernate-entitymanager</artifactId>-->
<!--                <version>${hibernate.version}</version>-->
<!--              </dependency>-->
LAVENIER's avatar
LAVENIER committed
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
              <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-spatial</artifactId>
                <version>${hibernate.version}</version>
                <exclusions>
                  <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                  </exclusion>
                </exclusions>
              </dependency>
              <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>${hsqldb.version}</version>
              </dependency>
              <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
              </dependency>
              <dependency>
LAVENIER's avatar
LAVENIER committed
554
555
556
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
LAVENIER's avatar
LAVENIER committed
557
              </dependency>
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
              <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${jaxbApiVersion}</version>
              </dependency>
              <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-core</artifactId>
                <version>${jaxbSiteVersion}</version>
              </dependency>
              <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>${jaxbSiteVersion}</version>
              </dependency>
              <dependency>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
                <version>${activationVersion}</version>
              </dependency>
LAVENIER's avatar
LAVENIER committed
578
579
580
581
582
583
584
585
586
587
588
589
590
591
            </dependencies>
            <executions>
              <execution>
                <id>hbm2doc</id>
                <phase>pre-site</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
                      <classpath refid="maven.plugin.classpath" />
                    </taskdef>

LAVENIER's avatar
LAVENIER committed
592
593
594
<!--                    <ant antfile="${project.basedir}/src/main/ant/hibernate.xml" target="hbm2doc" inheritRefs="true" />-->

                    <!-- workaround (when no jdbc schema defined)-->
LAVENIER's avatar
LAVENIER committed
595
596
597
598
                    <replaceregexp match="hibernate.default_schema&quot;&gt;[^&lt;]*&lt;" replace="hibernate.default_schema&quot;&gt;${jdbc.reporting.schema}&lt;" flags="g" byline="false">
                      <fileset file="${hibernate.generated.cfg.path}" />
                    </replaceregexp>

LAVENIER's avatar
LAVENIER committed
599
                    <hibernatetool destdir="${project.reporting.outputDirectory}/hibernate">
LAVENIER's avatar
LAVENIER committed
600
                      <classpath>
601
                        <path location="${project.build.outputDirectory}" />
LAVENIER's avatar
LAVENIER committed
602
                      </classpath>
603
604

                      <jpaconfiguration persistenceunit="sumaris" />
LAVENIER's avatar
LAVENIER committed
605

606
                      <hbm2doc />
LAVENIER's avatar
LAVENIER committed
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
                    </hibernatetool>

                    <!-- restore the hibernate.cfg.xml -->
                    <replaceregexp match="hibernate.default_schema&quot;&gt;[^&lt;]*&lt;" replace="hibernate.default_schema&quot;&gt;${jdbc.schema}&lt;" flags="g" byline="false">
                      <fileset file="${hibernate.generated.cfg.path}" />
                    </replaceregexp>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>de.juplo</groupId>
            <artifactId>hibernate-maven-plugin</artifactId>
LAVENIER's avatar
LAVENIER committed
622
            <version>2.0.2.IFR</version>
LAVENIER's avatar
LAVENIER committed
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
            <executions>
              <execution>
                <id>queries2doc</id>
                <phase>pre-site</phase>
                <goals>
                  <goal>queries2doc</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <scanTestClasses>false</scanTestClasses>
              <format>true</format>
              <force>true</force>
              <hibernateConfig>${hibernate.generated.cfg.path}</hibernateConfig>
              <hibernateProperties>${hibernate.generated.cfg.dir}/hibernate.properties</hibernateProperties>
              <outputFile>${project.reporting.outputDirectory}/hibernate/queries/index.html</outputFile>
              <outputDirectory>${project.reporting.outputDirectory}/hibernate/queries</outputDirectory>
              <scanClasses>true</scanClasses>
              <url>${jdbc.url}</url>
              <username>${jdbc.username}</username>
              <password>${jdbc.password}</password>
              <!-- add queries files-->
              <mappings>
LAVENIER's avatar
LAVENIER committed
646
                ${project.build.outputDirectory}/META-INF/orm.xml
LAVENIER's avatar
LAVENIER committed
647
648
649
650
651
652
653
654
655
656
657
              </mappings>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>run</id>

      <properties>
658
        <exec.mainClass>net.sumaris.core.InitTests</exec.mainClass>
LAVENIER's avatar
LAVENIER committed
659
        <exec.classpathScope>test</exec.classpathScope>
660
        <sumaris.log.file>${project.build.directory}/exec.log</sumaris.log.file>
LAVENIER's avatar
LAVENIER committed
661
662
663
664
      </properties>
    </profile>
  </profiles>
</project>