Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-remote-webapp / pom.xml @ ec02ae73

History | View | Annotate | Download (14.6 KB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<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">
3
  <modelVersion>4.0.0</modelVersion>
4
  <parent>
5
    <artifactId>cdmlib-parent</artifactId>
6
    <groupId>eu.etaxonomy</groupId>
7
    <version>5.18.0-SNAPSHOT</version>
8
    <relativePath>../pom.xml</relativePath>
9
  </parent>
10
  <artifactId>cdmlib-remote-webapp</artifactId>
11
  <name>CDM Remote Webapp</name>
12
  <packaging>war</packaging>
13

    
14
  <properties>
15
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16
    <!-- by default 
17
      no further args by now, see profiles for alternative run configurations -->
18
  </properties>
19

    
20
  <profiles>
21
    <profile>
22
      <id>local-repository</id>
23
      <activation>
24
        <property>
25
          <name>localrepo</name>
26
        </property>
27
      </activation>
28
      <repositories>
29
        <repository>
30
          <id>EditLocalRepository</id>
31
          <url>file://${localrepo}/eu/etaxonomy/</url>
32
          <releases>
33
            <enabled>false</enabled>
34
            <updatePolicy>always</updatePolicy>
35
          </releases>
36
          <snapshots>
37
            <enabled>true</enabled>
38
            <updatePolicy>always</updatePolicy>
39
          </snapshots>
40
        </repository>
41
      </repositories>
42
    </profile>
43
    <!-- ========================= PROFILE : db-create ========================= -->
44
    <!--  How to execute from parent project:
45
        1.) mvn package -DskipTests 
46
        2.) mvn integration-test -pl cdmlib-remote-webapp -Pdb-create
47
    -->
48
    <profile>
49
      <id>db-create</id>
50
      <activation>
51
        <property>
52
          <name>db-create</name>
53
        </property>
54
      </activation>
55
      <properties>
56
        <integrationTest.jvmArgs.cdm.datasource>h2_cdm_blank</integrationTest.jvmArgs.cdm.datasource>
57
        <integrationTest.jvmArgs.cdm.forceSchemaCreate>true</integrationTest.jvmArgs.cdm.forceSchemaCreate>
58
        <integrationTest.log4j.configuration>${project.build.directory}/target/test-classes/log4j.properties</integrationTest.log4j.configuration>
59
      </properties>
60
      <build>
61
        <plugins>
62
          <plugin>
63
            <artifactId>maven-failsafe-plugin</artifactId>
64
            <version>2.16</version>
65
            <configuration>
66
              <forkCount>3</forkCount>
67
              <reuseForks>true</reuseForks>
68
            </configuration>
69
            <executions>
70
              <execution>
71
                <goals>
72
                  <goal>integration-test</goal>
73
                  <goal>verify</goal>
74
                </goals>
75
                <configuration>
76
                  <includes>
77
                    <include>**/ForceSchemaCreateIT.java</include>
78
                  </includes>
79
                </configuration>
80
              </execution>
81
            </executions>
82
          </plugin>
83
        </plugins>
84
      </build>
85
    </profile>
86
    <!-- ========================= DEFAULT-PROFILE : db-use ========================= -->
87
     <profile>
88
      <id>db-use</id>
89
      <activation>
90
        <activeByDefault>true</activeByDefault>
91
        <property>
92
          <name>db-use</name>
93
        </property>
94
      </activation>
95
      <properties>
96
        <integrationTest.jvmArgs.cdm.datasource>h2_cdmTest</integrationTest.jvmArgs.cdm.datasource>
97
        <integrationTest.jvmArgs.cdm.forceSchemaCreate>false</integrationTest.jvmArgs.cdm.forceSchemaCreate>
98
        <integrationTest.log4j.configuration>${project.build.directory}/target/test-classes/log4j.properties</integrationTest.log4j.configuration>
99
      </properties>
100
      <build>
101
        <plugins>
102
          <plugin>
103
            <artifactId>maven-failsafe-plugin</artifactId>
104
            <version>2.16</version>
105
            <configuration>
106
              <forkCount>3</forkCount>
107
              <reuseForks>true</reuseForks>
108
            </configuration>
109
            <executions>
110
              <execution>
111
                <goals>
112
                  <goal>integration-test</goal>
113
                  <goal>verify</goal>
114
                </goals>
115
                <configuration>
116
                  <systemPropertyVariables>
117
                    <cdm.datasource>h2_cdmTest</cdm.datasource>
118
                  </systemPropertyVariables>
119
                  <excludes>
120
                    <exclude>**/ForceSchemaCreateIT.java</exclude>
121
                  </excludes>
122
                </configuration>
123
              </execution>
124
            </executions>
125
          </plugin>
126
        </plugins>
127
      </build>
128
    </profile>
129
  </profiles>
130
  <dependencies>
131
    <dependency>
132
      <groupId>eu.etaxonomy</groupId>
133
      <artifactId>cdmlib-remote</artifactId>
134
      <exclusions>
135
        <!-- exclude all jdbc drivers from the war. Jdbc drivers must only 
136
          be added to {APPLICATION_CONTAINER}/lib see http://dev.e-taxonomy.eu/trac/ticket/4955 
137
          and http://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder -->
138
        <exclusion>
139
          <groupId>eu.etaxonomy</groupId>
140
          <artifactId>cdmlib-db</artifactId>
141
        </exclusion>
142
      </exclusions>
143
    </dependency>
144
    <dependency>
145
      <groupId>eu.etaxonomy</groupId>
146
      <artifactId>cdmlib-test</artifactId>
147
      <scope>test</scope>
148
    </dependency>
149
    <dependency>
150
      <!-- TODO this is also offered by cdmlib-remote, can it be removed? 
151
        What does provided mean? -->
152
      <groupId>javax.servlet</groupId>
153
      <artifactId>javax.servlet-api</artifactId>
154
      <scope>provided</scope>
155
    </dependency>
156

    
157
    <dependency>
158
      <groupId>xmlunit</groupId>
159
      <artifactId>xmlunit</artifactId>
160
    </dependency>
161
    <!-- JsonView -->
162
    <!-- -->
163
    <dependency>
164
      <groupId>org.springframework</groupId>
165
      <artifactId>spring-oxm</artifactId>
166
    </dependency>
167

    
168
    <!-- XmlView -->
169
    <dependency>
170
      <!-- this is also offered by cdmlib-remote. Can it be removed? -->
171
      <groupId>com.thoughtworks.xstream</groupId>
172
      <artifactId>xstream</artifactId>
173
      <exclusions>
174
        <!-- https://stackoverflow.com/questions/17077922/maven-xpp3-versus-xpp3-min -->
175
        <!-- But maybe we can exclude xpp3 instead, not sure if it is directly needed or only for xstream -->
176
        <exclusion>
177
            <groupId>xpp3</groupId>
178
            <artifactId>xpp3_min</artifactId>
179
        </exclusion>
180
      </exclusions>
181
    </dependency>
182
    <dependency>
183
      <groupId>xpp3</groupId>
184
      <artifactId>xpp3</artifactId>
185
    </dependency>
186

    
187
    <!-- JSP TAG LIBS -->
188
    <dependency>
189
      <groupId>taglibs</groupId>
190
      <artifactId>standard</artifactId>
191
      <version>1.1.2</version>
192
    </dependency>
193
    <dependency>
194
      <groupId>taglibs</groupId>
195
      <artifactId>x</artifactId>
196
      <version>1.1.2</version>
197
      <type>tld</type>
198
    </dependency>
199
    <!-- swagger -->
200
    <dependency>
201
      <groupId>io.springfox</groupId>
202
      <artifactId>springfox-swagger2</artifactId>
203
      <scope>test</scope>
204
    </dependency>
205
    <!-- dependencies for springfox-swagger2, added explicitly to pin the 
206
      version these dependencies are also required by the cdmlib! -->
207
    <dependency>
208
      <groupId>com.fasterxml.jackson.core</groupId>
209
      <artifactId>jackson-databind</artifactId>
210
    </dependency>
211
    <dependency>
212
      <groupId>com.fasterxml.jackson.core</groupId>
213
      <artifactId>jackson-core</artifactId>
214
    </dependency>
215
    <dependency>
216
      <groupId>com.fasterxml.jackson.core</groupId>
217
      <artifactId>jackson-annotations</artifactId>
218
    </dependency>
219
    <!-- END of dependencies for swagger-springmvc, added explicitely -->
220

    
221
    <!-- testing -->
222
    <dependency>
223
      <groupId>junit</groupId>
224
      <artifactId>junit</artifactId>
225
      <scope>test</scope>
226
    </dependency>
227

    
228
    <!-- Connection Pooling and jdbc -->
229
    <dependency>
230
      <groupId>org.hibernate</groupId>
231
      <artifactId>hibernate-c3p0</artifactId>
232
      <scope>test</scope>
233
    </dependency>
234
    <!-- <dependency> -->
235
    <!-- <groupId>com.mchange</groupId> -->
236
    <!-- <artifactId>c3p0</artifactId> -->
237
    <!-- <scope>test</scope> -->
238
    <!-- </dependency> -->
239
    <!-- Profiling -->
240
    <dependency>
241
      <groupId>com.yourkit</groupId>
242
      <artifactId>yjp-controller-api-redist</artifactId>
243
      <scope>test</scope>
244
    </dependency>
245
  </dependencies>
246

    
247
  <build>
248
    <resources>
249
      <resource>
250
        <!-- replace the place holders like ${...} in datasources.xml -->
251
        <filtering>true</filtering>
252
        <directory>src/test/resources</directory>
253
        <targetPath>../test-classes</targetPath>
254
        <includes>
255
          <include>datasources.xml</include>
256
        </includes>
257
      </resource>
258
      <resource>
259
        <!-- all other test resources without filtering -->
260
        <directory>src/test/resources</directory>
261
        <targetPath>../test-classes</targetPath>
262
        <excludes>
263
          <exclude>datasources.xml</exclude>
264
        </excludes>
265
      </resource>
266
      <resource>
267
        <!-- all main resources without filtering -->
268
        <directory>src/main/resources</directory>
269
      </resource>
270
    </resources>
271
    <plugins>
272
      <plugin>
273
        <artifactId>maven-failsafe-plugin</artifactId>
274
        <version>2.16</version>
275
        <!-- configuration per maven profile -->
276
        
277
<!--         <configuration> -->
278
<!--           <forkCount>3</forkCount> -->
279
<!--           <reuseForks>true</reuseForks> -->
280
<!--         </configuration> -->
281
<!--         <executions> -->
282
<!--           <execution> -->
283
<!--             <id>default</id> -->
284
<!--             <goals> -->
285
<!--               <goal>integration-test</goal> -->
286
<!--               <goal>verify</goal> -->
287
<!--             </goals> -->
288
<!--             <configuration> -->
289
<!--               <systemPropertyVariables> -->
290
<!--                 <cdm.datasource>h2_cdmTest</cdm.datasource> -->
291
<!--               </systemPropertyVariables> -->
292
<!--               <excludes> -->
293
<!--                 <exclude>**/ForceSchemaCreateIT.java</exclude> -->
294
<!--               </excludes> -->
295
<!--             </configuration> -->
296
<!--           </execution> -->
297
<!--         </executions> -->
298
      </plugin>
299
      <plugin>
300
        <groupId>org.eclipse.jetty</groupId>
301
        <artifactId>jetty-maven-plugin</artifactId>
302
        <version>9.4.15.v20190215</version>
303
        <configuration>
304
          <stopKey>stop</stopKey>
305
          <stopPort>9199</stopPort>
306
          <scanIntervalSeconds>10</scanIntervalSeconds>
307
          <useTestScope>true</useTestScope>
308
          <!-- jvmArgs will only be used when running mvn jetty:run-forked -->
309
          <jvmArgs>-Xmx2000M 
310
            -Dcdm.datasource=${integrationTest.jvmArgs.cdm.datasource}
311
            -Duser.home=${basedir}/target/target/
312
            -Dcdm.beanDefinitionFile=${project.build.directory}/test-classes/datasources.xml
313
            -Dspring.profiles.active=remoting
314
            -Dcdm.forceSchemaCreate=${integrationTest.jvmArgs.cdm.forceSchemaCreate}
315
            -Dlog4j.configuration=${integrationTest.jvmArgs.log4j.configuration}
316
            -Dorg.eclipse.jetty.annotations.AnnotationParser.LEVEL=OFF
317
           </jvmArgs>
318
          <jettyXml>${basedir}/src/test/resources/etc/jetty/jetty.xml,${basedir}/src/test/resources/etc/jetty/jetty-http.xml</jettyXml>
319
          <!-- <jettyXml>./src/test/resources/etc/jetty/jetty.xml,./src/test/resources/etc/jetty/jetty-http.xml,./src/test/resources/etc/jetty/jetty-ssl.xml,./src/test/resources/etc/jetty/jetty-https.xml</jettyXml> -->
320
          <systemProperties>
321
            <force>true</force>
322
            <systemProperty>
323
              <name>cdm.datasource</name>
324
              <value>${integrationTest.jvmArgs.cdm.datasource}</value>
325
            </systemProperty>
326
            <systemProperty>
327
              <!-- The lucene index should be placed into the target folder, 
328
                so user.home needs to be set to this folder. user.home needs to be overridden 
329
                since it already exists, thus the force option is turned on above -->
330
              <name>user.home</name>
331
              <value>${basedir}/target/</value>
332
            </systemProperty>
333
            <systemProperty>
334
              <!-- datasources.xml is prepared by <plugins><resources>..</resources> above -->
335
              <name>cdm.beanDefinitionFile</name>
336
              <value>${project.build.directory}/test-classes/datasources.xml</value>
337
            </systemProperty>
338
            <systemProperty>
339
                <name>cdm.forceSchemaCreate</name>
340
                <value>${integrationTest.jvmArgs.cdm.forceSchemaCreate}</value>
341
            </systemProperty>
342
            <systemProperty>
343
              <!-- start with swagger profile so that the swagger doc can 
344
                be generated -->
345
              <name>spring.profiles.active</name>
346
              <value>swagger</value>
347
            </systemProperty>
348
            <systemProperty>
349
                <name>log4j.configuration</name>
350
                <value>${integrationTest.jvmArgs.log4j.configuration}</value>
351
            </systemProperty>
352
          </systemProperties>
353
        </configuration>
354
        <executions>
355
          <execution>
356
            <id>start-jetty</id>
357
            <phase>pre-integration-test</phase>
358
            <goals>
359
              <goal>start</goal>
360
            </goals>
361
            <configuration>
362
              <scanIntervalSeconds>0</scanIntervalSeconds>
363
              <daemon>true</daemon>
364
            </configuration>
365
          </execution>
366
          <execution>
367
            <id>stop-jetty</id>
368
            <phase>post-integration-test</phase>
369
            <goals>
370
              <goal>stop</goal>
371
            </goals>
372
          </execution>
373
        </executions>
374
        <dependencies>
375
            <dependency>
376
                <groupId>org.apache.taglibs</groupId>
377
                <artifactId>taglibs-standard-impl</artifactId>
378
                <version>1.2.5</version>
379
            </dependency>
380
        </dependencies>
381
      </plugin>
382
      <plugin>
383
        <groupId>org.apache.maven.plugins</groupId>
384
        <artifactId>maven-war-plugin</artifactId>
385
        <version>2.6</version>
386
        <executions>
387
          <execution>
388
            <!-- The war must be created after running the integration-tests, 
389
              since the SwaggerGroupsIT test populates the classes/api-docs-static/ folder 
390
              with static swagger doc files. They are otherwise not packed into the war 
391
              file. -->
392
            <phase>verify</phase>
393
            <goals>
394
              <goal>war</goal>
395
            </goals>
396
          </execution>
397
        </executions>
398
      </plugin>
399
      <plugin>
400
        <artifactId>maven-resources-plugin</artifactId>
401
        <version>2.7</version>
402
        <configuration>
403
          <escapeWindowsPaths>false</escapeWindowsPaths>
404
        </configuration>
405
      </plugin>
406
    </plugins>
407
  </build>
408
</project>
Add picture from clipboard (Maximum size: 40 MB)