Skip to content

Commit 3a8121f

Browse files
groldanaaimejodygarnett
committed
Upgrade GeoWebCache build to Java 17
* Upgrade build to use Java 17 as the baseline version. * Configure maven-enforcer-plugin to require Java 17. * Upgrade GitHub Actions workflows to use Java 17. * Update documentation for Java 17, including developer and user guides. * Upgrade Jetty from 9.x to 10.0.25, the last version to support `javax.servlet`. * Replace `com.google.common.base.Objects.equal()` with `java.util.Objects.equal()`. * Update test configurations to use `localhost:8080` instead of deprecated demo servers. * Fix REST integration tests and address other issues found during local testing on Java 17. * Increase heap size for the QA build profile. * Fix swapped Assert.equals arguments Plugin version upgrades: * maven-jar-plugin 2.4 -> 3.0.2 * maven-enforcer-plugin 3.0.0-M3 -> 3.5.0 * maven-compiler-plugin 3.10.1 -> 3.14.0 * maven-surefire-plugin 2.22.1 -> 3.5.3 * maven-failsafe-plugin 3.3.1 -> 3.5.3 * maven-war-plugin 3.3.2 -> 3.4.0 * jetty-maven-plugin 9.4.14.v20181114 -> 10.0.25 * maven-javadoc-plugin 3.4.1 -> 3.11.2 * maven-checkstyle-plugin 3.1.1 -> 3.6.0 Co-authored-by: Andrea Aime <[email protected]> Co-authored-by: Jody Garnett <[email protected]>
1 parent 8b658d7 commit 3a8121f

File tree

129 files changed

+791
-586
lines changed

Some content is hidden

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

129 files changed

+791
-586
lines changed

.github/workflows/azure-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
java-version: [ 11, 17, 21 ]
25+
java-version: [ 17, 21 ]
2626
steps:
2727
- uses: actions/checkout@v4
2828
- uses: actions/setup-java@v3
@@ -57,7 +57,7 @@ jobs:
5757
- uses: actions/setup-java@v3
5858
with:
5959
distribution: 'temurin'
60-
java-version: 11
60+
java-version: 17
6161
cache: 'maven'
6262

6363
- name: Tests against Azure

.github/workflows/integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Set up JDK 11
19+
- name: Set up JDK 17
2020
uses: actions/setup-java@v3
2121
with:
22-
java-version: 11
22+
java-version: 17
2323
distribution: 'temurin'
2424
- uses: actions/checkout@v4
2525
- name: Maven repository caching

.github/workflows/linux.yml

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

99
env:
10-
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 -Xmx512m -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
10+
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 -Xmx1g -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
1111

1212
jobs:
13-
openjdk11:
14-
runs-on: [ubuntu-22.04]
15-
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v3
19-
with:
20-
java-version: 11
21-
distribution: 'temurin'
22-
- name: Maven repository caching
23-
uses: actions/cache@v3
24-
with:
25-
path: ~/.m2/repository
26-
key: gwc-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27-
restore-keys: |
28-
${{ runner.os }}-maven-
29-
- name: Build with Maven
30-
run: mvn -B clean install -Dspotless.apply.skip=true -Dall -T2 --file geowebcache/pom.xml
31-
- name: Remove SNAPSHOT jars from repository
32-
run: |
33-
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
34-
3513
openjdk17:
3614
runs-on: [ubuntu-22.04]
3715
steps:
@@ -80,10 +58,10 @@ jobs:
8058
runs-on: [ubuntu-22.04]
8159
steps:
8260
- uses: actions/checkout@v4
83-
- name: Set up JDK 11
61+
- name: Set up JDK 17
8462
uses: actions/setup-java@v3
8563
with:
86-
java-version: 11
64+
java-version: 17
8765
distribution: 'temurin'
8866
- name: Maven repository caching
8967
uses: actions/cache@v3

.github/workflows/macos.yml

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

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up JDK 11
16+
- name: Set up JDK 17
1717
uses: actions/setup-java@v3
1818
with:
19-
java-version: 11
19+
java-version: 17
2020
distribution: 'temurin'
2121
- name: Maven repository caching
2222
uses: actions/cache@v3

.github/workflows/windows.yml

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

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up JDK 11
16+
- name: Set up JDK 17
1717
uses: actions/setup-java@v3
1818
with:
19-
java-version: 11
19+
java-version: 17
2020
distribution: 'temurin'
2121
- name: Maven repository caching
2222
uses: actions/cache@v3

RELEASE_NOTES.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
GeoWebCache 1.28-SNAPSHOT (2025-04-03)
22
--------------------------------------
33

4-
<Release Description>
4+
Stable release, GeoNetwork 1.28.0 is the first release requiring a Java 17 environment.
55

66
Improvements:
77
+++++++++++++
8-
- <New feature>
8+
- Java 17 minimum
99

1010
Fixes:
1111
++++++
1212
- <Bug fix>
1313

14+
Updates:
15+
++++++++
16+
17+
- Upgrade to GeoTools 34.x
1418

1519
GeoWebCache 1.27.0 (2025-04-02)
1620
------------------------------

documentation/en/build.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
<target name="docs"
5151
description="Generate html documentation">
52+
<antcall target="sphinx-init"/>
5253

5354
<mkdir dir="${build.directory}"/>
5455
<antcall target="sphinx">
@@ -72,13 +73,26 @@
7273

7374
<target name="site"
7475
description="Generate html documentation">
76+
<antcall target="autobuild-init"/>
77+
7578

7679
<mkdir dir="${build.directory}"/>
7780
<antcall target="autobuild">
7881
<param name="id" value="user" />
7982
</antcall>
8083
</target>
8184

85+
<target name="sphinx-init" unless="sphinx.available">
86+
<local name="message"/>
87+
<property name="message" value="sphinx-build not available:${line.separator}
88+
${line.separator}
89+
virtualenv venv${line.separator}
90+
source venv/bin/activate${line.separator}
91+
pip install -r requirements.txt${line.separator}
92+
"/>
93+
<fail message="${message}"/>
94+
</target>
95+
8296
<target name="sphinx" if="sphinx.available">
8397
<local name="argLine"/>
8498
<property name="argLine" value="-D release=${project.version} -q -W --keep-going -b html -d &quot;${build.directory}/user/doctrees&quot; . &quot;${build.directory}/user/html&quot;"/>
@@ -88,6 +102,16 @@
88102
</exec>
89103
</target>
90104

105+
<target name="autobuild-init" unless="autobuild.available">
106+
<local name="message"/>
107+
<property name="message" value="autobuild not available:${line.separator}
108+
${line.separator}
109+
virtualenv venv${line.separator}
110+
source venv/bin/activate${line.separator}
111+
pip install -r requirements.txt${line.separator}
112+
"/>
113+
<fail message="${message}"/>
114+
</target>
91115

92116
<target name="autobuild" if="autobuild.available">
93117
<local name="argLine"/>

documentation/en/user/source/configuration/layers/howto.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ It is recommended to use a special XML editing tool or at the very least a text
3333

3434
Two recommended free editors, both of which have support for XML validation, are:
3535

36-
* `jEdit <http://www.jedit.org/>`_ (cross platform)
37-
* `Notepad++ <http://notepad-plus-plus.org/>`_ (Windows only)
36+
* `jEdit <https://www.jedit.org>`_ (cross platform)
37+
* `Notepad++ <https://notepad-plus-plus.org/>`_ (Windows only)
3838

3939
It is also possible to validate an XML document outside of a text editor environment.
4040

documentation/en/user/source/configuration/storage.rst

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,57 @@ does not explicitly indicate which blobstore shall be used.
2323

2424
.. note:: **there will always be a "default" blobstore**. If a blobstore to be used by default is not explicitly configured, one will
2525
be created automatically following the legacy cache location lookup mechanism used in versions prior to 1.8.0.
26-
26+
27+
.. _configuration.file
28+
2729
Configuration File
2830
------------------
2931

30-
The location of the configuration file, :file:`geowebcache.xml`, will be defined by the ``GEOWEBCACHE_CACHE_DIR`` application argument.
32+
The location of the configuration file, :file:`geowebcache.xml`, will be defined by the ``GEOWEBCACHE_CACHE_DIR`` application parameter.
3133

32-
There are a few ways to define this argument:
34+
There are a few ways to define ``GEOWEBCACHE_CACHE_DIR``:
3335

3436
* JVM system environment variable
3537
* Servlet context parameteter
3638
* Operating system environment variable
3739

3840
The variable in all cases is defined as ``GEOWEBCACHE_CACHE_DIR``.
3941

40-
To set as a JVM system environment variable, add the parameter ``-DGEOWEBCACHE_CACHE_DIR=<path>`` to your servlet startup script.
41-
In Tomcat, this can be added to the Java Options (JAVA_OPTS) variable in the startup script.
42-
43-
To set as a servlet context parameter, edit the GeoWebCache :file:`web.xml` file and add the following code:
44-
45-
.. code-block:: xml
46-
47-
<context-param>
48-
<param-name>GEOWEBCACHE_CACHE_DIR</param-name>
49-
<param-value>PATH</param-value>
50-
</context-param>
51-
52-
where ``PATH`` is the location of the cache directory.
42+
1. To set as a JVM system environment variable, add the parameter ``-DGEOWEBCACHE_CACHE_DIR=<path>`` to your servlet startup script.
5343

54-
To set as an operating system environment variable, run one of the the following commands:
44+
In Tomcat, this can be added to the Java Options (``JAVA_OPTS``) variable in the startup script, or by creating :file:`setenv.sh` / :file:`setenv.bat`:
5545

56-
Windows::
46+
2. To set as a servlet context parameter, edit the GeoWebCache :file:`web.xml` file and add the following code:
5747

58-
> set GEOWEBCACHE_CACHE_DIR=<path>
48+
.. code-block:: xml
49+
50+
<context-param>
51+
<param-name>GEOWEBCACHE_CACHE_DIR</param-name>
52+
<param-value>PATH</param-value>
53+
</context-param>
5954
60-
Linux/OS X::
55+
where ``PATH`` is the location of the cache directory.
6156
62-
$ export GEOWEBCACHE_CACHE_DIR=<path>
57+
3. To set as an operating system environment variable, run one of the the following commands:
6358

64-
Finally, although not recommended, it is possible to set this location directly in the :file:`geowebcache-core-context.xml` file. Uncomment this code:
59+
Windows::
60+
61+
> set GEOWEBCACHE_CACHE_DIR=<path>
62+
63+
Linux/OS X::
64+
65+
$ export GEOWEBCACHE_CACHE_DIR=<path>
6566

66-
.. code-block:: xml
67+
4. Not recommended: It is possible to set this location directly in the :file:`geowebcache-core-context.xml` file.
68+
However this file will be replaced each update:
6769

68-
<!-- bean id="gwcBlobStore" class="org.geowebcache.storage.blobstore.file.FileBlobStore" destroy-method="destroy">
69-
<constructor-arg value="/tmp/gwc_blobstore" />
70-
</bean -->
70+
.. code-block:: xml
71+
72+
<!-- bean id="gwcBlobStore" class="org.geowebcache.storage.blobstore.file.FileBlobStore" destroy-method="destroy">
73+
<constructor-arg value="/tmp/gwc_blobstore" />
74+
</bean -->
7175
72-
making sure to edit the path. As usual, any changes to the servlet configuration files will require :ref:`configuration.reload`.
76+
making sure to edit the path. As usual, any changes to the servlet configuration files will require :ref:`configuration.reload`.
7377

7478
.. note:: if ``GEOWEBCACHE_CACHE_DIR`` is not provided by any of the above mentioned methods, the directory will default
7579
to the temporary storage folder specified by the web application container. (For Tomcat, this is the :file:`temp` directory inside the root.)

documentation/en/user/source/development/index.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ You are encouraged to help contribute code to GeoWebCache. To do so, you will f
77

88
This is the current prerequisites:
99

10-
* Java 8 (`OpenJDK <http://openjdk.java.net>`__ linux, `OpenJDK Temurin 8 <https://adoptium.net/?variant=openjdk8&jvmVariant=hotspot>` windows and macOS installers)
11-
* `Maven <http://maven.apache.org/>`_
12-
* `Git <http://git-scm.com>`_
10+
* Java 17 (`OpenJDK <https://openjdk.java.net>`__ linux, `OpenJDK Temurin 17 <https://adoptium.net/temurin/releases/?variant=openjdk8&jvmVariant=hotspot&os=any&arch=any&version=17>` windows and macOS installers)
11+
* `Maven <https://maven.apache.org/>`_
12+
* `Git <https://git-scm.com>`_
1313

14-
Please make sure you use **Java 8** to compile to ensure that we don't accidentally use new features only available in Java 11.
14+
Please make sure you use **Java 17** to compile to ensure that we don't accidentally use new features only available in Java 21.
1515

1616
You are encouraged to join the `GeoWebCache Developers mailing list <https://lists.sourceforge.net/lists/listinfo/geowebcache-devel>`__ to discuss your work. It is always a good idea to ask whether anyone else has already solved the same problem.
1717

@@ -27,28 +27,28 @@ Setting Up
2727

2828
.. code-block:: bash
2929
30-
set JAVA_HOME=c:\Program Files\Temurin\jdk8u322-b06
30+
set JAVA_HOME=c:\Program Files\Temurin\jdk-17.0.15_6
3131
3232
Linux/OS X:
3333

3434
.. code-block:: bash
3535
36-
export JAVA_HOME=/opt/jdk1.7.0_79
36+
export JAVA_HOME=/opt/jdk-17.0.15_6
3737
38-
#. You can download maven from http://maven.apache.org/download.html, unpack and include the :file:`bin` directory in your PATH variable.
38+
#. You can download maven from https://maven.apache.org/download.html, unpack and include the :file:`bin` directory in your PATH variable.
3939

4040
Windows:
4141

4242
.. code-block:: bash
4343
44-
set M2_HOME = C:\java\apache-maven-3.8.5
44+
set M2_HOME = C:\java\apache-maven-3.9.5
4545
set PATH=%PATH%;%M2_HOME%\bin;%JAVA_HOME%\bin
4646
4747
Linux:
4848

4949
.. code-block:: bash
5050
51-
export M2_HOME = ~/java/apache-maven-3.8.5
51+
export M2_HOME = ~/java/apache-maven-3.9.5
5252
export PATH=$PATH:$M2_HOME/bin:$JAVA_HOME/bin
5353
5454
For more detail instructions on maven see the `download page <http://maven.apache.org/download.cgi>`_.
@@ -89,6 +89,9 @@ Build
8989
9090
cd web
9191
mvn jetty:run
92+
93+
The service is available on http://localhost:8081/geonetwork allowing local testing with http://localhost:8080/geoserver layers. To change the port number use ``jetty.http.port``
94+
as describde in `jetty 10 documentation <https://jetty.org/docs/jetty/10/programming-guide/maven-jetty/jetty-maven-plugin.html>`_.
9295

9396
#. A WAR is built as the last step in ``mvn clean install`` above.
9497

0 commit comments

Comments
 (0)