-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpom.xml
452 lines (400 loc) · 15.2 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>
<groupId>de.scrum-master.spock</groupId>
<artifactId>spock-powermock</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<organization>
<name>Scrum-Master.de - Agile Project Management</name>
<url>https://scrum-master.de</url>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<!--
Enable automatic use of Parrot parser for Groovy-Eclipse in order to compile e.g. Groovy 3 Java-style lambdas.
Same as '<fork>true</fork>' for Maven Compiler and an alternative to '-Dgroovy.antlr4=true'. See also:
https://github.com/groovy/groovy-eclipse/issues/1107
https://github.com/groovy/groovy-eclipse/issues/1137
-->
<maven.compiler.fork>true</maven.compiler.fork>
<!--
Defined by build-helper:rootlocation.
Unfortunately, for IntelliJ IDEA we still need "-DprojectRootDir=..." in <projectRootDir>/.mvn/jvm.config.
-->
<!--suppress UnresolvedMavenProperty -->
<projectRootDir>${rootlocation}</projectRootDir>
<!-- See org.spockframework:spock-core, entry 'junit-bom' and then check the used platform in the JUnit BoM -->
<version.junit>5.8.1</version.junit>
<version.junit-platform>1.8.1</version.junit-platform>
<version.testng>7.1.0</version.testng>
<version.groovy>4.0.6</version.groovy>
<version.groovy-eclipse-compiler>3.8.0</version.groovy-eclipse-compiler>
<version.groovy-eclipse-batch>4.0.6-02</version.groovy-eclipse-batch>
<version.spock>2.3-groovy-4.0-SNAPSHOT</version.spock>
<!-- 2.0.7 contains an important bug fix making '@Rule PowerMockRule' usable from Spock -->
<version.powermock>2.0.9</version.powermock>
<version.easymock>4.0.1</version.easymock>
<version.jmockit>1.49</version.jmockit>
<version.surefire>3.0.0-M7</version.surefire>
<instrumented-jre.jar>
${projectRootDir}/instrument-jre-classes/target/instrument-jre-classes-${project.version}.jar
</instrumented-jre.jar>
<bytebuddy.version>1.12.7</bytebuddy.version>
<bytebuddy.jar>
${settings.localRepository}/net/bytebuddy/byte-buddy/${bytebuddy.version}/byte-buddy-${bytebuddy.version}.jar
</bytebuddy.jar>
<sarek.version>1.0-SNAPSHOT</sarek.version>
<sarek.jar>
${settings.localRepository}/dev/sarek/sarek-special/${sarek.version}/sarek-special-${sarek.version}.jar
</sarek.jar>
</properties>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>groovy-plugins-release</id>
<url>https://groovy.jfrog.io/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>UTF8</encoding>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>${version.groovy-eclipse-compiler}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>${version.groovy-eclipse-batch}</version>
</dependency>
</dependencies>
</plugin>
<!--
<plugin>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>${version.groovy-eclipse-compiler}</version>
<extensions>true</extensions>
</plugin>
-->
<!--
Below version 2.22.0 Surefire will not execute Spock 2 tests,
but e.g Maven 3.5.2 and 3.6.0 use Surefire 2.12.4 by default.
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire}</version>
<configuration>
<!-- Do not reuse forked VMs because of potentially unexpected instrumentation bleed-over -->
<reuseForks>false</reuseForks>
<argLine>
-Dfile.encoding=UTF8
<!--
On Java 9+ you cannot prepend to the bootstrap classpath anymore, only append.
Instead, you can patch each module separately via:
-'-patch-module <module>=<file>(<pathsep><file>)*
See http://openjdk.java.net/jeps/261#Patching-module-content.
-->
<!-- Java < 9 -->
<!-- -Xbootclasspath/p:${instrumented-jre.jar}-->
<!-- Java 9+ -->
--patch-module java.base=${instrumented-jre.jar}
<!-- Java 9+: needed for hot-attaching agents (e.g. PowerMock) -->
-Djdk.attach.allowAttachSelf=true
<!-- Java 16+ -->
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.ref=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
<!---javaagent:"${settings.localRepository}/org/jmockit/jmockit/${version.jmockit}/jmockit-${version.jmockit}.jar"-->
<!--
The combination Sarek + PowerMock on JDK 8 only works when using the Java agent,
not the Spock or TestNG plugins (https://github.com/raphw/byte-buddy/issues/1191).
On JDK 9+, it also works with the plugins.
-->
<!-- -javaagent:"${sarek.jar}=UnFinal,verbXXXose"-->
</argLine>
<systemPropertyVariables>
<!-- Necessary for SarekJUnit5Extension auto-detection -->
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
</systemPropertyVariables>
</configuration>
</plugin>
<!--
Below version 2.22.0 Failsafe will not execute Spock 2 tests,
but e.g Maven 3.5.2 and 3.6.0 use Failsafe 2.12.4 by default.
-->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.surefire}</version>
<configuration>
<!-- Do not reuse forked VMs because of potentially unexpected instrumentation bleed-over -->
<reuseForks>false</reuseForks>
<argLine>
<!---Dfile.encoding=UTF8-->
<!---javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${version.jmockit}/jmockit-${version.jmockit}.jar-->
</argLine>
<systemPropertyVariables>
<!-- Necessary for SarekJUnit5Extension auto-detection -->
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!-- We use compiler source/target 8 -> enforce Java 8+ -->
<requireJavaVersion>
<version>1.8</version>
</requireJavaVersion>
<!-- maven.multiModuleProjectDirectory: introduced in 3.3.1, important bug fix in 3.3.9 -->
<requireMavenVersion>
<version>3.3.9</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<!-- Version 3.2.0 fixes goal 'rootlocation' -->
<version>3.2.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>set-project-root-dir</id>
<phase>validate</phase>
<goals>
<!--
TODO:
Investigate Directory Maven Plugin as an alternative, also with regard to IDEA compatibility
(needs .mvn/jvm.config?). https://github.com/jdcasey/directory-maven-plugin#highest-basedir-goal
-->
<goal>rootlocation</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<!-- Groovy -->
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${version.groovy}</version>
<scope>test</scope>
</dependency>
<!-- Spock -->
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>${version.spock}</version>
<scope>test</scope>
</dependency>
<!--
JUnit 4 compatibility layer is needed for @Rule PowermockRule.
Please keep even though reported as unused by dependency:analyze!
-->
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-junit4</artifactId>
<version>${version.spock}</version>
<scope>test</scope>
</dependency>
<!-- JUnit 4 version used by Spock, needed for @Rule PowermockRule -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- PowerMock -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>${version.powermock}</version>
<scope>test</scope>
</dependency>
<!-- PowerMock Mockito 2 API -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${version.powermock}</version>
<scope>test</scope>
</dependency>
<!-- PowerMock EasyMock API -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>${version.powermock}</version>
<scope>test</scope>
</dependency>
<!-- EasyMock version used by PowerMock -->
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>${version.easymock}</version>
<scope>test</scope>
</dependency>
<!--
JUnit 4 agent-based @Rule PowermockRule is the only working option in Spock 2,
but due to https://github.com/raphw/byte-buddy/issues/1191 only on JRE 9+
-->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule-agent</artifactId>
<version>${version.powermock}</version>
<scope>test</scope>
</dependency>
<!-- JMockit agent for mocking final classes/methods -->
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${version.jmockit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.scrum-master</groupId>
<artifactId>bytebuddy-agent</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.sarek</groupId>
<artifactId>sarek-special</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.sarek</groupId>
<artifactId>sarek-junit4-runner</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.sarek</groupId>
<artifactId>sarek-spock-extension</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dev.sarek</groupId>
<artifactId>sarek-junit5-extension</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency>
<groupId>de.scrum-master.spock</groupId>
<artifactId>instrument-jre-classes</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>instrument-jre-classes</module>
<module>perform-tests</module>
<module>kotlin-sample</module>
</modules>
<!--
Caveat: Automatic, JDK-based profile activation can *not* be inherited by child POMs defining
the same profiles. Thus, we have to repeat activation conditions there.
Note: We can check if automatic profile activation works via mvn help:active-profiles.
-->
<profiles>
<profile>
<id>jdk-8</id>
<activation>
<jdk>[1.8,1.9)</jdk>
</activation>
</profile>
<profile>
<id>jdk-9</id>
<activation>
<jdk>[1.9,)</jdk>
</activation>
</profile>
<profile>
<id>jdk-16-to-xx</id>
<activation>
<jdk>[16,)</jdk>
</activation>
</profile>
</profiles>
</project>