-
-
Notifications
You must be signed in to change notification settings - Fork 651
Expand file tree
/
Copy pathpom.xml
More file actions
437 lines (428 loc) · 19.3 KB
/
Copy pathpom.xml
File metadata and controls
437 lines (428 loc) · 19.3 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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<?xml version="1.0" encoding="UTF-8"?>
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<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>
<parent>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-administration-test</artifactId>
<version>10.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-platform-administration-test-tests</artifactId>
<name>XWiki Platform - Administration - Tests - Functional Tests</name>
<!-- TODO: Move to use "functional-test" in the future when http://jira.codehaus.org/browse/MNG-1911 is fixed,
see https://jira.xwiki.org/browse/XWIKI-7683 -->
<packaging>jar</packaging>
<description>Tests for the Administration Application</description>
<properties>
<!-- Override in order to add the Packager Plugin -->
<xwikiCfgPlugins>\
com.xpn.xwiki.plugin.skinx.JsSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.JsSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.LinkExtensionPlugin,\
com.xpn.xwiki.plugin.packaging.PackagePlugin,\
com.xpn.xwiki.plugin.rightsmanager.RightsManagerPlugin
</xwikiCfgPlugins>
<!-- We need to use the mail module in some tests (e.g. ResetPasswordTest) -->
<xwikiDbHbmCommonExtraMappings>mailsender.hbm.xml</xwikiDbHbmCommonExtraMappings>
<xwikiCfgSuperadminPassword>pass</xwikiCfgSuperadminPassword>
<!-- XWiki.ResetPassword uses the saveAsAuthor() API which performs a check on whether permissions have been dropped
and since the PR checker works by dropping permissions, it causes the user to become guest and thus the doc
save fails. Thus we need to exclude the page from the PR checker -->
<xwikiPropertiesAdditionalProperties>test.prchecker.excludePattern=.*:XWiki\.ResetPassword|.*:XWiki\.ResetPasswordComplete</xwikiPropertiesAdditionalProperties>
</properties>
<dependencies>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-administration-ui</artifactId>
<version>${project.version}</version>
<type>xar</type>
</dependency>
<!-- We have to bundle an implementation for the refactoring API because some tests need to delete pages. -->
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-refactoring-default</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-test-ui</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-administration-test-pageobjects</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- We currently need to depend on mail-ui in the test because it contains the Mail.SendMailConfigClass.
We can not have administration-ui depend on mail-ui, because mail-ui already depends on administration-ui
which would create a loop. mail-ui just needs the configurable class stuff from administration-ui, so when
that gets refactored out, we can fix the dependency directly in administration-ui and not have anything here
specific to mail. -->
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-mail-ui</artifactId>
<version>${project.version}</version>
<type>xar</type>
</dependency>
<dependency>
<groupId>com.icegreen</groupId>
<artifactId>greenmail</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.spotify</groupId>
<artifactId>docker-client</artifactId>
<version>8.10.1</version>
<classifier>shaded</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<!-- TODO: Remove when the http://jira.codehaus.org/browse/MNG-1911 is fixed, see also
https://jira.xwiki.org/browse/XWIKI-7683 -->
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-packager-plugin</artifactId>
<version>${project.version}</version>
<dependencies>
<!-- Some tests require mail setup and interaction (e.g. ResetPasswordTest) -->
<!-- TODO: remove the need for this dependency in the future. The reason we need it right now is because
the Packager Mojo will use the Import Mojo to import XARs but since we've defined the
xwikiDbHbmCommonExtraMappings property up there, it's using it and thus we need the mapping file to be
in the classpath. -->
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-mail-send-storage</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>generate-test-resources</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Execute the functional tests against an XWiki running in docker container (MySQL + Tomcat) -->
<id>docker</id>
<build>
<plugins>
<!-- Don't run the packager mojo which is only useful when generating a HSQLDB/Jetty testing distribution -->
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-packager-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Start and Stop the docker images (DB, XWiki) -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.23.0</version>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<!-- TODO: Ideally we should use a network and not a link since links are deprecated. However networks
don't seem to work with the fabric8 plugin, see
https://groups.google.com/forum/#!topic/fabric8/4taOto4QEXI
This is what should be used:
<autoCreateCustomNetworks>true</autoCreateCustomNetworks>
<image>
...
<run>
<network>
<mode>custom</mode>
<name>xwiki-maven</name>
</network>
...
<run>
<dependsOn>
<container>mysql-xwiki</container>
</dependsOn>
<network>
<mode>custom</mode>
<name>xwiki-maven</name>
</network>
...
-->
<imagePullPolicy>IfNotPresent</imagePullPolicy>
<showLogs>true</showLogs>
<images>
<!-- Execute the MySQL image in a container -->
<image>
<alias>mysql-xwiki</alias>
<name>mysql:5.7</name>
<run>
<volumes>
<bind>
<volume>${project.build.directory}/docker/mysql:/var/lib/mysql</volume>
</bind>
</volumes>
<env>
<MYSQL_ROOT_PASSWORD>xwiki</MYSQL_ROOT_PASSWORD>
<MYSQL_USER>xwiki</MYSQL_USER>
<MYSQL_PASSWORD>xwiki</MYSQL_PASSWORD>
<MYSQL_DATABASE>xwiki</MYSQL_DATABASE>
</env>
<cmd>
<arg>--character-set-server=utf8</arg>
<arg>--collation-server=utf8_bin</arg>
<arg>--explicit-defaults-for-timestamp=1</arg>
</cmd>
<log>
<prefix>%n|</prefix>
<date>default</date>
<color>cyan</color>
</log>
<wait>
<log>.*port: 3306 MySQL Community Server.*</log>
<time>60000</time>
</wait>
</run>
</image>
<image>
<alias>xwiki</alias>
<name>xwiki:latest</name>
<run>
<links>
<link>mysql-xwiki</link>
</links>
<volumes>
<bind>
<volume>${project.build.directory}/docker/xwiki:/usr/local/xwiki</volume>
<volume>${user.home}/.m2/repository:/usr/local/repository</volume>
</bind>
</volumes>
<env>
<!-- For hibernate.cfg.xml -->
<DB_USER>xwiki</DB_USER>
<DB_PASSWORD>xwiki</DB_PASSWORD>
<DB_DATABASE>xwiki</DB_DATABASE>
<DB_HOST>mysql-xwiki</DB_HOST>
<!-- For xwiki.cfg -->
<EXTRA_CFG><![CDATA[
xwiki.plugins = \
com.xpn.xwiki.plugin.skinx.JsSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.JsSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.CssSkinFileExtensionPlugin,\
com.xpn.xwiki.plugin.skinx.LinkExtensionPlugin,\
com.xpn.xwiki.plugin.packaging.PackagePlugin,\
com.xpn.xwiki.plugin.rightsmanager.RightsManagerPlugin
xwiki.superadminpassword=pass
]]></EXTRA_CFG>
<!-- For xwiki.properties -->
<!-- The following extra properties are set for the following reasons:
1) XWiki.ResetPassword uses the saveAsAuthor() API which performs a check on whether
permissions have been dropped and since the PR checker works by dropping permissions,
it causes the user to become guest and thus the doc save fails. Thus we need to
exclude the page from the PR checker
2) We skip the DW since we're not installing a flavor and it would appear otherwise.
3) In order for the provisioning plugin defined below to be able to install the XARs
required for the functional tests, we need to configure XWiki to use the local Maven
repository as the XWiki Extension repository. Since dependencies should have been
built locally before (or downloaded from the Maven remote repo) they're present in
the local repository
4) Override openoffice auto start since we don't need it for these tests and that will
make XWiki start faster.
-->
<EXTRA_PROPERTIES><![CDATA[
test.prchecker.excludePattern=.*:XWiki\.ResetPassword|.*:XWiki\.ResetPasswordComplete
distribution.automaticStartOnMainWiki=false
extension.repositories=maven-local:maven:file:///usr/local/repository
openoffice.autoStart = false
]]></EXTRA_PROPERTIES>
</env>
<ports>
<port>8080:8080</port>
</ports>
<wait>
<http>
<url>http://localhost:8080/bin/get/Main/WebHome</url>
</http>
<time>100000</time>
</wait>
<log>
<prefix>%n|</prefix>
<date>default</date>
<color>red</color>
</log>
</run>
</image>
<image>
<name>xwiki-maven</name>
<run>
<links>
<link>xwiki</link>
</links>
<volumes>
<bind>
<volume>${project.basedir}:/usr/src/mymaven</volume>
<volume>${user.home}/.m2:/root/.m2</volume>
<!--volume>${project.basedir}/target:/usr/src/mymaven/target</volume-->
</bind>
</volumes>
<workingDir>/usr/src/mymaven</workingDir>
<cmd>
<arg>mvn</arg>
<arg>verify</arg>
<arg>-Pdocker-maven</arg>
</cmd>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Don't start the functional tests since they'll be started by the docker container that will
execute Maven and the tests using the "docker-maven" profile -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>docker-maven</id>
<build>
<plugins>
<!-- Don't run the packager mojo which is only useful when generating a HSQLDB/Jetty testing distribution -->
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-packager-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- Provision the running XWiki instance with the extension we want to test and its transitive
dependencies -->
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-provision-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<xwikiRESTURL>http://localhost:8080/rest</xwikiRESTURL>
<extensionIds>
<extensionId>
<id>org.xwiki.platform:xwiki-platform-administration-ui</id>
<version>${project.version}</version>
</extensionId>
<extensionId>
<id>org.xwiki.platform:xwiki-platform-mail-ui</id>
<version>${project.version}</version>
</extensionId>
</extensionIds>
<!-- Install pages as superadmin to have the proper rights -->
<installUserReference>XWiki.superadmin</installUserReference>
</configuration>
<executions>
<execution>
<id>install</id>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Tell the XWiki functional tests to not start/stop XWiki since we're doing that with Docker -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemProperties>
<xwiki.test.startXWiki>false</xwiki.test.startXWiki>
<!-- XWiki is deployed as ROOT in the docker container: we need to tell that to the test framework so
that it uses proper URLs -->
<xwiki.test.context></xwiki.test.context>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>clover</id>
<!-- Add the Clover JAR to the WAR so that it's available at runtime when XWiki executes.
It's needed because instrumented jars in the WAR will call Clover APIs at runtime when they execute. -->
<dependencies>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Add the Clover JAR to the Packager plugin runtime classpath since the Packager plugin uses java classes
that have been instrumented with Clover (XWiki oldcore for example) -->
<plugin>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-tool-packager-plugin</artifactId>
<version>${project.version}</version>
<dependencies>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover</artifactId>
<version>${clover.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>