Skip to content

Commit f79b907

Browse files
groldanaaimejodygarnett
committed
[GEOS-11845] Upgrade GeoServer and GeoWebCache Build to Java 17
* Upgrade build for Java 17 as base Java version * Configure maven-enforcer-plugin to require Java 17 * Upgrade github actions workflows to use Java 17. * Centralize maven plugin versions in the root pom's pluginManagement section. * Reorganize root pom properties into sections * Update docs for Java 17 * Plugin version upgrades: * jacoco 0.8.7 -> 0.8.13 * maven-checkstyle-plugin 3.1.1 -> 3.6.0 * maven-compiler-plugin 3.10.1 -> 3.14.0 * maven-javadoc-plugin 2.10.3 -> 3.11.2 * maven-jar-plugin 2.4 -> 3.0.2 * maven-surefire-plugin 2.22.2 -> 3.5.3 * Upgrade Jetty 9.x to 10.0.25, last version supporting javax.servlet * Configure Eclipse to use Java 17 for maven-eclipse-plugin * Parameter encoding of maven-checkstyle-plugin changed to inputEncoding in 3.2 * Fix compilation errors when compiling with -Werror and Java 17. This is independent of the pmd and errorprone checks. Thackling them first. * non-varargs call of varargs method with inexact argument type for last parameter; * Of special interest, upgrading GridCoverageReader implementations to delcare varargs respecting the inherited interfaces, and fix calls to read(null) with read() * deprecated item is not annotated with @deprecated * Required upgrading javacc-maven-plugin:2.3 -> 3.1.1, changing the depregated goal `jjtree` to `jjtree-javacc`, and updating wcs1_1/src/main/java/org/geoserver/wcs/kvp/rangesubset/rangeset.jjt to change JDK_VERSION = "1.5" to "17" and the encoding to UTF-8 * unchecked call to put(K,V) as a member of the raw type java.util.Map * java.lang.System has been deprecated and marked for removal * attempt to synchronize on an instance of a value-based class * Upgrade errorprone to work with Java 17: * add suggested compiler args `-Xep:DeadException:WARN -Xep:GuardedBy:OFF` * Add additional errorprone exclusions and fix trivial errors * Erroprone fixes: * [AssertEqualsArgumentOrderChecker] Arguments are swapped in assertEquals-like call * [AttemptedNegativeZero] -0 is the same as 0. For the floating-point negative zero, use -0.0 * [BigDecimalEquals] BigDecimal#equals has surprising behavior: it also compares scale. * [ClassCanBeStatic] Inner class is non-static but does not reference enclosing class * [ExtendsObject] `T extends Object` is redundant (unless you are using the Checker Framework) * [IdentityHashMapUsage] IdentityHashMap usage shouldn't be intermingled with Map * [InlineMeInliner] Migrate (via inlining) away from `Strings.repeat()` * [InputStreamSlowMultibyteRead] Please also override int read(byte[], int, int), otherwise multi-byte reads from this input stream are likely to be slow. * [IterableAndIterator] Class should not implement both `Iterable` and `Iterator` (e.g. KMLRawReader) * [JUnitIncompatibleType] The types of this assertion are mismatched: type `X` is not compatible with `Y` * [MissingCasesInEnumSwitch] Non-exhaustive switch; either add a default or handle the remaining cases * [ModifyCollectionInEnhancedForLoop] Modifying a collection while iterating over it in a loop may cause a ConcurrentModificationException to be thrown or lead to undefined behavior * [ObjectToString] X is final and does not override Object.toString, so converting it to a string will print its identity * [SameNameButDifferent] e.g.: The name `Geometry` refers to [org.geoserver.wps.ppio.GMLPPIO.GML2.Geometry, org.geoserver.wps.ppio.GMLPPIO.GML3.Geometry] within this file. It may be confusing to have the same name refer to multiple types. Consider qualifying them for clarity. * [SuperCallToObjectMethod] `super.hashCode()` is equivalent to `System.identityHashCode(this)` here * [TypeNameShadowing] Found type parameters shadowing other declared types * [UnnecessaryLongToIntConversion] Converting a long or Long to an int to pass as a long parameter is usually not necessary. If this conversion is intentional, consider `Longs.constrainToRange()` instead. * [UnsafeReflectiveConstructionCast] Prefer `asSubclass` instead of casting the result of `newInstance`, to detect classes of incorrect type before invoking their constructors. This way, if the class is of the incorrect type,it will throw an exception before invoking its constructor. * [URLEqualsHashCode] Avoid hash-based containers of java.net.URL--the containers rely on equals() and hashCode(), which cause java.net.URL to make blocking internet connections. Co-authored-by: Andrea Aime <andrea.aime@gmail.com> Co-authored-by: Jody Garnett <jody.garnett@gmail.com>
1 parent 7f36a97 commit f79b907

File tree

377 files changed

+1375
-1170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+1375
-1170
lines changed

.github/workflows/assembly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88
cancel-in-progress: true
99

1010
env:
11-
MAVEN_OPTS: -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 -Daether.syncContext.named.time=120 -Daether.syncContext.named.factory=file-lock -Daether.syncContext.named.nameMapper=file-gav -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx756m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dspotless.apply.skip=true
11+
MAVEN_OPTS: -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 -Daether.syncContext.named.time=120 -Daether.syncContext.named.factory=file-lock -Daether.syncContext.named.nameMapper=file-gav -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx2g -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dspotless.apply.skip=true
1212

1313
jobs:
1414
build:
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
include:
1919
- os: ubuntu-22.04
20-
jdk: 11
20+
jdk: 17
2121
dist: 'temurin'
2222
steps:
2323
- uses: actions/checkout@v4

.github/workflows/cite.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/setup-java@v4
2525
with:
2626
distribution: 'temurin'
27-
java-version: '11'
27+
java-version: '17'
2828
- name: Set up Maven
2929
uses: stCarolas/setup-maven@v5
3030
with:
@@ -55,9 +55,6 @@ jobs:
5555
fail-fast: false # Prevents other matrix jobs from being canceled if one fails
5656
matrix:
5757
suite: [ogcapi-features10, ogcapi-tiles10, wms11, wms13, wmts10, wfs10, wfs11, wfs20, wcs11, geotiff11, gpkg12]
58-
include: # Variation for wcs20, which requires Java 17 due to Teamengine 6
59-
- suite: wcs20
60-
java-version: 17
6158
steps:
6259
- name: Checkout repository (shallow clone)
6360
uses: actions/checkout@v4
@@ -68,7 +65,7 @@ jobs:
6865
uses: actions/setup-java@v4
6966
with:
7067
distribution: 'temurin'
71-
java-version: ${{ matrix.java-version || '11' }}
68+
java-version: '17'
7269

7370
- name: Set up Maven
7471
uses: stCarolas/setup-maven@v5

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: Set up JDK 11
21+
- name: Set up JDK 17
2222
uses: actions/setup-java@v4
2323
with:
24-
java-version: 11
24+
java-version: 17
2525
distribution: 'temurin'
2626
- name: Set up Maven
2727
uses: stCarolas/setup-maven@v5
@@ -50,10 +50,10 @@ jobs:
5050
runs-on: ubuntu-22.04
5151
steps:
5252
- uses: actions/checkout@v3
53-
- name: Set up JDK 11
53+
- name: Set up JDK 17
5454
uses: actions/setup-java@v4
5555
with:
56-
java-version: 11
56+
java-version: 17
5757
distribution: 'temurin'
5858
- name: Set up Maven
5959
uses: stCarolas/setup-maven@v5

.github/workflows/javadoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
matrix:
2121
include:
2222
- os: ubuntu-22.04
23-
jdk: 11
23+
jdk: 17
2424
dist: 'temurin'
2525
steps:
2626
- uses: actions/checkout@v4
27-
- name: Set up JDK 11
27+
- name: Set up JDK 17
2828
uses: actions/setup-java@v4
2929
with:
3030
java-version: ${{ matrix.jdk }}

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
jdk: [ 11, 17, 21 ]
21+
jdk: [ 17, 21 ]
2222
dist: [ 'temurin' ]
2323
os: [ 'ubuntu-22.04' ]
2424
runs-on: ${{ matrix.os }}

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Set up JDK 11
23+
- name: Set up JDK 17
2424
uses: actions/setup-java@v4
2525
with:
26-
java-version: 11
26+
java-version: 17
2727
distribution: 'temurin'
2828
- name: Set up Maven
2929
uses: stCarolas/setup-maven@v5

.github/workflows/postgis_appschema_online.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
--health-retries 5
2727
2828
steps:
29-
- name: Set up JDK 11
29+
- name: Set up JDK 17
3030
uses: actions/setup-java@v4
3131
with:
32-
java-version: 11
32+
java-version: 17
3333
distribution: 'temurin'
3434
- uses: actions/checkout@v2
3535
- name: Maven repository caching

.github/workflows/qa.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ concurrency:
77
cancel-in-progress: true
88

99
env:
10-
MAVEN_OPTS: -Xmx1024m -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 -Daether.syncContext.named.time=120 -Daether.syncContext.named.factory=file-lock -Daether.syncContext.named.nameMapper=file-gav -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
10+
MAVEN_OPTS: -Xmx2g -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 -Daether.syncContext.named.time=120 -Daether.syncContext.named.factory=file-lock -Daether.syncContext.named.nameMapper=file-gav -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
1111

1212
jobs:
1313
QA:
1414
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up JDK 11
17+
- name: Set up JDK 17
1818
uses: actions/setup-java@v4
1919
with:
20-
java-version: 11
20+
java-version: 17
2121
distribution: 'temurin'
2222
- name: Set up Maven
2323
uses: stCarolas/setup-maven@v5

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Set up JDK 11
23+
- name: Set up JDK 17
2424
uses: actions/setup-java@v4
2525
with:
26-
java-version: 11
26+
java-version: 17
2727
distribution: 'temurin'
2828
- name: Set up Maven
2929
uses: stCarolas/setup-maven@v5

.mvn/jvm.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
2+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
3+
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
4+
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
5+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
6+
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
7+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
8+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
9+
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
10+
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED

0 commit comments

Comments
 (0)