Skip to content

Commit b1eab6b

Browse files
committed
Modular builds
1 parent 2c55b40 commit b1eab6b

File tree

6 files changed

+200
-34
lines changed

6 files changed

+200
-34
lines changed

.travis.yml

+23-22
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,34 @@ sudo: false
33

44
cache:
55
directories:
6-
- "$HOME/.m2"
6+
- "$HOME/.m2"
77

88
jobs:
99
include:
10-
# 1.1 Semver check
11-
- stage: test
12-
jdk: openjdk8
13-
script: mvn verify -Pcheck-semantic-version -DskipTests=true -DskipITs=true
14-
env: CHECK_SEMANTIC_VERSION=true
10+
# 1.1 Semver check
11+
- stage: test
12+
jdk: openjdk11
13+
script: mvn verify -Pcheck-semantic-version -DskipTests=true -DskipITs=true
14+
env: CHECK_SEMANTIC_VERSION=true
1515

16-
# 1.2 Check JDK 8,10,ea
17-
- stage: test
18-
jdk: openjdk8
19-
script: mvn clean verify
20-
after_success:
21-
- mvn clean jacoco:prepare-agent test jacoco:report coveralls:report
22-
- jdk: openjdk10
23-
script: mvn -q verify
24-
- jdk: openjdk11
25-
script: mvn -q verify
16+
# 1.2 Tests
17+
- stage: test
18+
jdk: openjdk11
19+
script: mvn clean verify
20+
env: VERIFY=true
2621

27-
# 1.3 Check javadoc. We need to use this version to properly detect errors.
28-
- jdk: oraclejdk11
29-
env: JAVADOC=true
30-
script:
31-
- mvn javadoc:jar
22+
# 1.3 Coverage
23+
- stage: test
24+
jdk: openjdk11
25+
script: mvn clean jacoco:prepare-agent test jacoco:report coveralls:report
26+
env: COVERAGE=true
27+
28+
# 1.4 Javadoc
29+
- jdk: openjdk11
30+
env: JAVADOC=true
31+
script:
32+
- mvn javadoc:jar
3233

3334
branches:
3435
only:
35-
- master
36+
- master

archetype/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<artifactId>cucumber-archetype</artifactId>
1313
<packaging>maven-archetype</packaging>
14-
<name>cucumber-archetype</name>
14+
<name>Cucumber JVM: Archetype</name>
1515
<description>Cucumber JVM: Maven Archetype</description>
1616

1717
<!-- Not used by this module, but used by the integration tests of

junit-platform-engine/pom.xml

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<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">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34

45
<parent>
@@ -11,10 +12,6 @@
1112
<packaging>jar</packaging>
1213
<name>Cucumber-JVM: JUnit Platform Engine</name>
1314

14-
<properties>
15-
<project.Automatic-Module-Name>io.cucumber.junit.platform.engine</project.Automatic-Module-Name>
16-
</properties>
17-
1815
<profiles>
1916
<profile>
2017
<!-- IDEA doesn't calculate shaded dependencies correctly and tries
@@ -83,4 +80,21 @@
8380
</dependency>
8481
</dependencies>
8582

83+
<build>
84+
<plugins>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-jar-plugin</artifactId>
88+
<configuration combine.self="override">
89+
<!-- Ignore Automatic module name -->
90+
<archive>
91+
<manifestEntries>
92+
<Multi-Release>true</Multi-Release>
93+
</manifestEntries>
94+
</archive>
95+
</configuration>
96+
</plugin>
97+
</plugins>
98+
</build>
99+
86100
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module io.cucumber.junit.platform.engine {
2+
requires org.opentest4j;
3+
requires org.junit.platform.commons;
4+
requires transitive org.apiguardian.api;
5+
6+
requires io.cucumber.core;
7+
8+
requires transitive org.junit.platform.engine;
9+
10+
exports io.cucumber.junit.platform.engine;
11+
12+
provides org.junit.platform.engine.TestEngine with io.cucumber.junit.platform.engine.CucumberTestEngine;
13+
14+
}

openejb/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
<!--
7676
Using source level 1.7 in combination with openejb-core results in 'An unknown compilation
77-
error'. Use 1.6 instead and compile up to 1.7 to avoid this problem.
77+
error'. Use 1.6 instead and compile up to avoid this problem.
7878
-->
7979
<build>
8080
<plugins>

pom.xml

+142-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<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">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34
<parent>
45
<groupId>io.cucumber</groupId>
@@ -38,8 +39,17 @@
3839

3940

4041
<properties>
42+
<!-- Tool chains, ect -->
43+
<base.java.version>1.8</base.java.version>
44+
<javadoc.java.version>8</javadoc.java.version>
45+
<toolchain.vendor>openjdk</toolchain.vendor>
46+
<toolchain.java.version>11</toolchain.java.version>
47+
<!-- Enable multi-release profile when running from the release plugin -->
48+
<arguments>-Dmulti-release=true</arguments>
49+
4150
<!--Semantic version -->
4251
<apiguardian-api.version>1.1.0</apiguardian-api.version>
52+
4353
<!--Dependencies -->
4454
<cucumber-expressions.version>8.3.1</cucumber-expressions.version>
4555
<datatable.version>3.2.0</datatable.version>
@@ -272,6 +282,48 @@
272282
</profiles>
273283

274284
<build>
285+
<plugins>
286+
<plugin>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-toolchains-plugin</artifactId>
289+
<executions>
290+
<execution>
291+
<goals>
292+
<goal>toolchain</goal>
293+
</goals>
294+
</execution>
295+
</executions>
296+
<configuration>
297+
<toolchains>
298+
<jdk>
299+
<version>${toolchain.java.version}</version>
300+
<vendor>${toolchain.vendor}</vendor>
301+
</jdk>
302+
</toolchains>
303+
</configuration>
304+
</plugin>
305+
306+
<!-- enable Java 9,10,11 compilation -->
307+
<plugin>
308+
<groupId>org.apache.maven.plugins</groupId>
309+
<artifactId>maven-compiler-plugin</artifactId>
310+
<executions>
311+
<execution>
312+
<id>java9</id>
313+
<phase>compile</phase>
314+
</execution>
315+
<execution>
316+
<id>java10</id>
317+
<phase>compile</phase>
318+
</execution>
319+
<execution>
320+
<id>java11</id>
321+
<phase>compile</phase>
322+
</execution>
323+
</executions>
324+
</plugin>
325+
</plugins>
326+
275327
<pluginManagement>
276328
<plugins>
277329
<!-- Standard plugins - alphabetically -->
@@ -301,17 +353,96 @@
301353
</dependency>
302354
</dependencies>
303355
</plugin>
356+
<plugin>
357+
<groupId>org.apache.maven.plugins</groupId>
358+
<artifactId>maven-jar-plugin</artifactId>
359+
<executions>
360+
<execution>
361+
<id>default-jar</id>
362+
<configuration>
363+
<archive>
364+
<manifestEntries>
365+
<Multi-Release>true</Multi-Release>
366+
</manifestEntries>
367+
</archive>
368+
</configuration>
369+
</execution>
370+
</executions>
371+
</plugin>
372+
<plugin>
373+
<groupId>org.apache.maven.plugins</groupId>
374+
<artifactId>maven-compiler-plugin</artifactId>
375+
<configuration>
376+
<source>${base.java.version}</source>
377+
<target>${base.java.version}</target>
378+
</configuration>
379+
<executions>
380+
<!-- for Java 9 -->
381+
<execution>
382+
<id>java9</id>
383+
<phase>none</phase>
384+
<goals>
385+
<goal>compile</goal>
386+
</goals>
387+
<configuration>
388+
<release>9</release>
389+
<jdkToolchain>
390+
<version>9</version>
391+
</jdkToolchain>
392+
<compileSourceRoots>
393+
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
394+
</compileSourceRoots>
395+
<multiReleaseOutput>true</multiReleaseOutput>
396+
</configuration>
397+
</execution>
398+
399+
<!-- for Java 10 -->
400+
<execution>
401+
<id>java10</id>
402+
<phase>none</phase>
403+
<goals>
404+
<goal>compile</goal>
405+
</goals>
406+
<configuration>
407+
<release>10</release>
408+
<jdkToolchain>
409+
<version>10</version>
410+
</jdkToolchain>
411+
<compileSourceRoots>
412+
<compileSourceRoot>${project.basedir}/src/main/java10</compileSourceRoot>
413+
</compileSourceRoots>
414+
<multiReleaseOutput>true</multiReleaseOutput>
415+
</configuration>
416+
</execution>
417+
418+
<!-- for Java 11 -->
419+
<execution>
420+
<id>java11</id>
421+
<phase>none</phase>
422+
<goals>
423+
<goal>compile</goal>
424+
</goals>
425+
<configuration>
426+
<release>11</release>
427+
<jdkToolchain>
428+
<version>11</version>
429+
</jdkToolchain>
430+
<compileSourceRoots>
431+
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
432+
</compileSourceRoots>
433+
<multiReleaseOutput>true</multiReleaseOutput>
434+
</configuration>
435+
</execution>
436+
</executions>
437+
</plugin>
304438

305439
<plugin>
306440
<groupId>org.apache.maven.plugins</groupId>
307441
<artifactId>maven-javadoc-plugin</artifactId>
308442
<configuration>
309-
<use>false</use>
310-
<doclint>none</doclint>
311-
<source>8</source>
443+
<source>${javadoc.java.version}</source>
312444
<excludePackageNames>io.cucumber.examples:org.springframework</excludePackageNames>
313445
<links>
314-
<link>http://docs.oracle.com/javase/8/docs/api/</link>
315446
<link>http://junit.sourceforge.net/javadoc/</link>
316447
<link>https://junit.org/junit5/docs/current/api/</link>
317448
<link>https://javadoc.io/doc/org.testng/testng/7.0.0/</link>
@@ -356,6 +487,12 @@
356487
<version>3.0.0</version>
357488
</plugin>
358489

490+
<plugin>
491+
<groupId>org.apache.maven.plugins</groupId>
492+
<artifactId>maven-toolchains-plugin</artifactId>
493+
<version>1.1</version>
494+
</plugin>
495+
359496
<!-- Semantic version check -->
360497
<plugin>
361498
<groupId>org.revapi</groupId>

0 commit comments

Comments
 (0)