Skip to content

Commit 36ed23e

Browse files
authored
Merge pull request #1707 from bitwiseman/no-java8-build
Drop support for Building on Java 8
2 parents d0809b9 + e6aaf16 commit 36ed23e

File tree

2 files changed

+110
-146
lines changed

2 files changed

+110
-146
lines changed

.github/workflows/maven-build.yml

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,64 +19,44 @@ permissions:
1919

2020
jobs:
2121
build:
22-
name: build-only (Java ${{ matrix.java }})
22+
name: build-only (Java 17)
2323
runs-on: ubuntu-latest
2424
strategy:
25-
fail-fast: false
26-
matrix:
27-
java: [ 17 ]
25+
fail-fast: true
2826
steps:
29-
- uses: actions/checkout@v3
30-
- name: Set up JDK
31-
uses: actions/setup-java@v3
32-
with:
33-
java-version: ${{ matrix.java }}
34-
distribution: 'temurin'
35-
cache: 'maven'
36-
- name: Maven Install (skipTests)
37-
env:
38-
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
39-
run: mvn -B clean install -DskipTests --file pom.xml
27+
- uses: actions/checkout@v3
28+
- name: Set up JDK
29+
uses: actions/setup-java@v3
30+
with:
31+
java-version: 17
32+
distribution: 'temurin'
33+
cache: 'maven'
34+
- name: Maven Install (skipTests)
35+
env:
36+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
37+
run: mvn -B clean install -DskipTests --file pom.xml
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
name: maven-target-directory
41+
path: target/
42+
retention-days: 3
4043
site:
41-
name: site (Java ${{ matrix.java }})
44+
name: site (Java 17)
4245
runs-on: ubuntu-latest
4346
strategy:
4447
fail-fast: false
45-
matrix:
46-
java: [ 17 ]
47-
steps:
48-
- uses: actions/checkout@v3
49-
- name: Set up JDK
50-
uses: actions/setup-java@v3
51-
with:
52-
java-version: ${{ matrix.java }}
53-
distribution: 'temurin'
54-
cache: 'maven'
55-
- name: Maven Site
56-
env:
57-
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
58-
run: mvn -B clean site -D enable-ci --file pom.xml
59-
test-8:
60-
name: test (${{ matrix.os }}, Java 8)
61-
runs-on: ${{ matrix.os }}-latest
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
os: [ ubuntu ]
66-
java: [ 8 ]
6748
steps:
6849
- uses: actions/checkout@v3
6950
- name: Set up JDK
7051
uses: actions/setup-java@v3
7152
with:
72-
java-version: ${{ matrix.java }}
53+
java-version: 17
7354
distribution: 'temurin'
7455
cache: 'maven'
75-
# JDK 8
76-
- name: Maven Install with Code Coverage
77-
run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml
78-
- name: Codecov Report
79-
uses: codecov/[email protected]
56+
- name: Maven Site
57+
env:
58+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
59+
run: mvn -B clean site -D enable-ci --file pom.xml
8060
test:
8161
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
8262
runs-on: ${{ matrix.os }}-latest
@@ -104,3 +84,25 @@ jobs:
10484
env:
10585
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
10686
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
87+
- name: Codecov Report
88+
if: matrix.os == 'ubuntu' && matrix.java == '17'
89+
uses: codecov/[email protected]
90+
91+
test-java-8:
92+
name: test Java 8 (no-build)
93+
needs: build
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v3
97+
- uses: actions/download-artifact@v3
98+
with:
99+
name: maven-target-directory
100+
path: target
101+
- name: Set up JDK
102+
uses: actions/setup-java@v3
103+
with:
104+
java-version: 8
105+
distribution: 'temurin'
106+
cache: 'maven'
107+
- name: Maven Test (no build) Java 8
108+
run: mvn -B surefire:test -DfailIfNoTests -Dsurefire.excludesFile=src/test/resources/slow-or-flaky-tests.txt

pom.xml

Lines changed: 64 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@
241241
<artifactId>java18</artifactId>
242242
<version>1.0</version>
243243
</signature>
244+
<ignores>
245+
java.net.http.*
246+
</ignores>
244247
</configuration>
245248
<executions>
246249
<execution>
@@ -301,19 +304,52 @@
301304
</annotationProcessorPath>
302305
</annotationProcessorPaths>
303306
</configuration>
307+
<executions>
308+
<execution>
309+
<id>compile-java-11</id>
310+
<phase>compile</phase>
311+
<goals>
312+
<goal>compile</goal>
313+
</goals>
314+
<configuration>
315+
<release>11</release>
316+
<source>11</source>
317+
<target>11</target>
318+
<compileSourceRoots>
319+
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
320+
</compileSourceRoots>
321+
<multiReleaseOutput>true</multiReleaseOutput>
322+
</configuration>
323+
</execution>
324+
</executions>
304325
</plugin>
305326
<plugin>
306327
<artifactId>maven-surefire-plugin</artifactId>
328+
<configuration>
329+
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine}</argLine>
330+
</configuration>
307331
<executions>
308332
<execution>
309333
<id>default-test</id>
310334
<configuration>
311335
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
312-
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine}</argLine>
313336
</configuration>
314337
</execution>
315338
</executions>
316339
</plugin>
340+
<plugin>
341+
<groupId>org.apache.maven.plugins</groupId>
342+
<artifactId>maven-jar-plugin</artifactId>
343+
<version>3.3.0</version>
344+
<configuration>
345+
<archive>
346+
<manifestEntries>
347+
<Automatic-Module-Name>org.kohsuke.github.api</Automatic-Module-Name>
348+
<Multi-Release>true</Multi-Release>
349+
</manifestEntries>
350+
</archive>
351+
</configuration>
352+
</plugin>
317353
<plugin>
318354
<groupId>org.codehaus.mojo</groupId>
319355
<artifactId>animal-sniffer-maven-plugin</artifactId>
@@ -616,7 +652,7 @@
616652
<profiles>
617653
<!-- only enable slow-or-flaky-test if -Dtest= is not present -->
618654
<profile>
619-
<id>slow-or-flaky-test</id>
655+
<id>test-slow-multireleasejar-flaky</id>
620656
<activation>
621657
<property>
622658
<name>!test</name>
@@ -639,6 +675,32 @@
639675
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=okhttp</argLine>
640676
</configuration>
641677
</execution>
678+
<execution>
679+
<id>java11-test</id>
680+
<phase>integration-test</phase>
681+
<goals>
682+
<goal>test</goal>
683+
</goals>
684+
<configuration>
685+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
686+
<useSystemClassLoader>false</useSystemClassLoader>
687+
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
688+
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=httpclient</argLine>
689+
</configuration>
690+
</execution>
691+
<execution>
692+
<id>java11-urlconnection-test</id>
693+
<phase>integration-test</phase>
694+
<goals>
695+
<goal>test</goal>
696+
</goals>
697+
<configuration>
698+
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
699+
<useSystemClassLoader>false</useSystemClassLoader>
700+
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
701+
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=urlconnection</argLine>
702+
</configuration>
703+
</execution>
642704
<execution>
643705
<id>slow-or-flaky-test</id>
644706
<phase>integration-test</phase>
@@ -651,7 +713,6 @@
651713
<!-- There are some tests that take longer or are a little
652714
flaky. Run them here. -->
653715
<includesFile>src/test/resources/slow-or-flaky-tests.txt</includesFile>
654-
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine}</argLine>
655716
</configuration>
656717
</execution>
657718
</executions>
@@ -782,105 +843,6 @@
782843
</plugins>
783844
</build>
784845
</profile>
785-
<profile>
786-
<id>multirelease</id>
787-
<activation>
788-
<jdk>[11,)</jdk>
789-
</activation>
790-
<build>
791-
<plugins>
792-
<plugin>
793-
<groupId>org.codehaus.mojo</groupId>
794-
<artifactId>animal-sniffer-maven-plugin</artifactId>
795-
<configuration>
796-
<ignores>
797-
java.net.http.*
798-
</ignores>
799-
</configuration>
800-
</plugin>
801-
<plugin>
802-
<artifactId>maven-compiler-plugin</artifactId>
803-
<version>3.10.1</version>
804-
<executions>
805-
<execution>
806-
<id>compile-java-11</id>
807-
<phase>compile</phase>
808-
<goals>
809-
<goal>compile</goal>
810-
</goals>
811-
<configuration>
812-
<release>11</release>
813-
<source>11</source>
814-
<target>11</target>
815-
<compileSourceRoots>
816-
<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
817-
</compileSourceRoots>
818-
<multiReleaseOutput>true</multiReleaseOutput>
819-
</configuration>
820-
</execution>
821-
</executions>
822-
</plugin>
823-
<plugin>
824-
<groupId>org.apache.maven.plugins</groupId>
825-
<artifactId>maven-jar-plugin</artifactId>
826-
<version>3.3.0</version>
827-
<configuration>
828-
<archive>
829-
<manifestEntries>
830-
<Automatic-Module-Name>org.kohsuke.github.api</Automatic-Module-Name>
831-
<Multi-Release>true</Multi-Release>
832-
</manifestEntries>
833-
</archive>
834-
</configuration>
835-
</plugin>
836-
</plugins>
837-
</build>
838-
</profile>
839-
<profile>
840-
<id>multirelease-test</id>
841-
<activation>
842-
<jdk>[11,)</jdk>
843-
<property>
844-
<name>!test</name>
845-
</property>
846-
</activation>
847-
<build>
848-
<plugins>
849-
<plugin>
850-
<artifactId>maven-surefire-plugin</artifactId>
851-
<executions>
852-
<execution>
853-
<id>java11-test</id>
854-
<phase>integration-test</phase>
855-
<goals>
856-
<goal>test</goal>
857-
</goals>
858-
<configuration>
859-
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
860-
<useSystemClassLoader>false</useSystemClassLoader>
861-
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
862-
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=httpclient</argLine>
863-
</configuration>
864-
</execution>
865-
<execution>
866-
<id>java11-urlconnection-test</id>
867-
<phase>integration-test</phase>
868-
<goals>
869-
<goal>test</goal>
870-
</goals>
871-
<configuration>
872-
<classesDirectory>${project.basedir}/target/github-api-${project.version}.jar</classesDirectory>
873-
<useSystemClassLoader>false</useSystemClassLoader>
874-
<excludesFile>src/test/resources/slow-or-flaky-tests.txt</excludesFile>
875-
<argLine>@{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=urlconnection</argLine>
876-
</configuration>
877-
</execution>
878-
</executions>
879-
</plugin>
880-
</plugins>
881-
</build>
882-
</profile>
883-
884846
</profiles>
885847
<reporting>
886848
<plugins>

0 commit comments

Comments
 (0)