pom.xml
22.2 KB
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
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>runner</artifactId>
<name>Alfresco, Share and Solr4 Tomcat Runner</name>
<packaging>pom</packaging>
<description>Alfresco, Share and Solr4 Tomcat Runner</description>
<parent>
<groupId>org.alfresco.skype</groupId>
<artifactId>alfresco-skype-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<profiles>
<profile>
<id>run</id>
<!-- TODO: figure out a way to define these properties in a parent POM, they are now also duplicated
in the solr-config/pom.xml -->
<properties>
<alfresco.solr.dir>${alfresco.data.location}/solr4</alfresco.solr.dir>
<alfresco.solr.home.dir>${alfresco.solr.dir}/config</alfresco.solr.home.dir>
<alfresco.solr.data.dir>${alfresco.solr.dir}/data</alfresco.solr.data.dir>
</properties>
<build>
<plugins>
<!-- Copy and filter webapp context files - output dir is runner/target/contexts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-tomcat-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/contexts</outputDirectory>
<resources>
<resource>
<directory>tomcat</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Run Tomcat 7 embedded with Alfresco.war and Share.war contexts.
The solr4.war is fetched directly from the Maven repo, it is not built like the other WARs.
Plugin version is picked up from alfresco-sdk-parent.pom pluginManagement definition,
which also brings in the H2 database lib -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>run-wars</id>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
<configuration>
<ignorePackaging>true</ignorePackaging>
<!-- Make sure Catalina classes are picked up when we got virtual webapp contexts with classpaths -->
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
<path>/</path>
<systemProperties>
<solr.solr.home>${alfresco.solr.home.dir}</solr.solr.home>
</systemProperties>
<!-- Should this class loader delegate to the parent class loader before searching its
own repositories (i.e. the usual Java2 delegation model) -->
<!-- Prevent parent classloader delegation, each webapp loads.
If set to true then you will get a truckload of Solr logging as
the alf_data_dev/solr4/config/log4j-solr.properties file is not picked up.
This also fixes issues with the Google Guava Library, which this tomcat plugin uses
version 10.0.1 of but Solr uses 14.0.1 -->
<delegate>false</delegate>
<webapps>
<webapp>
<groupId>${project.groupId}</groupId>
<artifactId>repo</artifactId>
<version>${project.version}</version>
<type>war</type>
<!-- Make sure webapp is loaded with context and everything,
if set to 'false' then you will get 404 when trying to access the webapp from browser -->
<asWebapp>true</asWebapp>
<contextPath>/alfresco</contextPath>
<contextFile>${project.build.directory}/contexts/context-repo.xml</contextFile>
</webapp>
<webapp>
<groupId>${project.groupId}</groupId>
<artifactId>share</artifactId>
<version>${project.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
<contextPath>/share</contextPath>
<contextFile>${project.build.directory}/contexts/context-share.xml</contextFile>
</webapp>
<webapp>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-solr4</artifactId>
<version>${alfresco.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
<contextPath>/solr4</contextPath>
<contextFile>${project.build.directory}/contexts/context-solr.xml</contextFile>
</webapp>
</webapps>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Runs Share User Interface regression tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone (WebDriver wrapper).
NOTE: Assumes an already running Alfresco + Share at the default location ${share.client.url}
(e.g. by invoking:
$ mvn clean install -Prun,regression-testing
to run a specific test do:
$ mvn clean install -Prun,regression-testing -Dit.test=LoginPageTest
-->
<profile>
<id>regression-testing</id>
<properties>
<!-- Re-configure Tomcat 7 Plugin (see run profile) to fork so we can run tests in parallel -->
<!-- Note. the fork option does not fork a new JVM. Rather it is run in a thread created by the
Maven Launcher class (org.codehaus.plexus.classworlds.launcher.Launcher) that is invoked by the mvn command. -->
<maven.tomcat.fork>true</maven.tomcat.fork>
<!-- Make sure we are actually testing something -->
<skipTests>false</skipTests>
</properties>
<build>
<plugins>
<!-- Need to unpack the tests becuase of Jiras: -->
<!-- https://jira.codehaus.org/browse/SUREFIRE-997 -->
<!-- https://jira.codehaus.org/browse/SUREFIRE-1024 -->
<!-- Workaround for classloading issue in share-po (need to unpack it)-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>prepare-regression-test-resources</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifact>${alfresco.groupId}:share-po:${alfresco.version}:jar:tests</artifact>
<outputDirectory>${project.build.directory}/testng-resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<!-- Smaller test suite for Share, essential stuff like Login, Navigation, DocLib, and Search -->
<!-- Currently using our own config to be able to comment out one test class
<suiteXmlFile>${project.build.directory}/testng-resources/testng-alfresco-share.xml</suiteXmlFile> -->
<suiteXmlFile>${project.basedir}/test-ng/testng-alfresco-share.xml</suiteXmlFile>
</suiteXmlFiles>
<testClassesDirectory>${project.build.directory}/testng-resources</testClassesDirectory>
<systemPropertyVariables>
<!-- Where is the Alfresco Share Webapp that we are testing -->
<share.target>${share.client.url}</share.target>
</systemPropertyVariables>
<!-- The out-of-the-box Alfresco Share PO test classes does not follow the *IT.java
naming convention, they use *Test.java, so need to add that -->
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
<executions>
<execution>
<id>regression-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify-tests</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Bring in the Share Page Objects (PO) used in the regression tests -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId>
<version>${alfresco.version}</version>
<scope>test</scope>
<!-- Exclude version 2.39.0 of selenium that does not work with latest FF browsers, we include
version 2.45 later on here in this profile -->
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Bring in the Share Page Object (PO) regression tests that comes with Alfresco.
These tests cover the Alfresco Share Web Application -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId>
<version>${alfresco.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<!-- Exclude version 2.39.0 of selenium that does not work with latest FF browsers, we include
version 2.45 later on here in this profile -->
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Make sure we are running with newer selenium that works with newest FF (newer than 2.39.0) -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0-alfresco</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.45.0-alfresco</version>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api-2.5</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test NG is defined with test scope in share-po, so need it here too -->
<!-- Alfresco code creates a wrapper around Test NG -->
<dependency>
<groupId>org.alfresco.test</groupId>
<artifactId>alfresco-testng</artifactId>
<version>1.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
<!-- Runs functional domain specific tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone (WebDriver wrapper).
NOTE: Assumes an already running Alfresco + Share at the default location ${share.client.url}
(e.g. by invoking:
$ mvn clean install -Prun,functional-testing
to run a specific test do:
$ mvn clean install -Prun,functional-testing -Dit.test=DemoPageTestIT
-->
<profile>
<id>functional-testing</id>
<properties>
<!-- Re-configure Tomcat 7 Plugin (see run profile) to fork so we can run tests in parallel -->
<!-- Note. the fork option does not fork a new JVM. Rather it is run in a thread created by the
Maven Launcher class (org.codehaus.plexus.classworlds.launcher.Launcher) that is invoked by the mvn command. -->
<maven.tomcat.fork>true</maven.tomcat.fork>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${project.parent.basedir}/share-amp/target/test-classes/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testClassesDirectory>${project.parent.basedir}/share-amp/target/test-classes</testClassesDirectory>
<systemPropertyVariables>
<!-- Where is the Alfresco Share Webapp that we are testing -->
<share.target>${share.client.url}</share.target>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>functional-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify-tests</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Bring in the Share Page Objects (PO) used in our functional tests.
Without it TestNG cannot load our test class when it uses page objects such as LoginPage -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId>
<version>${alfresco.version}</version>
<scope>test</scope>
<!-- Exclude version 2.39.0 of selenium that does not work with latest FF browsers, we include
version 2.45 later on here in this profile -->
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Bring in the Share Page Object (PO) Tests that comes with Alfresco. It has
the org.alfresco.po.share.AbstractTest class that our custom tests extend.
Without it TestNG cannot load our test class -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId>
<version>${alfresco.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<!-- Exclude version 2.39.0 of selenium that does not work with latest FF browsers, we include
version 2.45 later on here in this profile -->
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Make sure we are running with newer selenium that works with newest FF (newer than 2.39.0) -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0-alfresco</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.45.0-alfresco</version>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api-2.5</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test NG is defined with test scope in share-po, so need it here too -->
<!-- Alfresco code creates a wrapper around Test NG -->
<dependency>
<groupId>org.alfresco.test</groupId>
<artifactId>alfresco-testng</artifactId>
<version>1.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
</profiles>
</project>