Skip to content

Conversation

@groldan
Copy link
Member

@groldan groldan commented May 28, 2025

  • Configure maven-enforcer-plugin to require Java 17

  • Configure maven-enforcer-plugin to require maven 3.8+ as done in GeoServer.

  • Upgrade github actions workflows to use Java 17

  • Remove cobertura-maven-plugin (modules/extension/xsd/**), as it is not compatible with Java 11

  • Update maven-javadoc-plugin configuration to use legacyMode=true and not fail due to module-info.java not present.

  • Plugin version upgrades:

    • jacoco 0.8.7 -> 0.8.13
    • maven-checkstyle-plugin 3.3.0 -> 3.6.0
    • maven-compiler-plugin 3.11.0 -> 3.14.0
    • maven-javadoc-plugin 3.6.3 -> 3.11.2
  • Add .mvn/jvm.config with necessary --add-exports and --add-opens for internal jdk.compiler packages.

    This ensures that build-time tools and compiler plugins interacting with javac internals can function correctly under Java 17's module system.

  • Centralize maven plugin versions in the root pom's pluginManagement section.


This is a coordinated effort across GeoTools, GeoServer, and GeoWebCache

@jodygarnett
Copy link
Contributor

jodygarnett commented Jun 25, 2025

Hey @groldan I am having some feedback when running mvn jetty:run locally:

Failed startup of context o.e.j.m.p.JettyWebAppContext@4e647f39{/geowebcache,file:///Users/jgarnett/dev/gwc/geowebcache/geowebcache/web/src/main/webapp/,UNAVAILABLE}{file:///Users/jgarnett/dev/gwc/geowebcache/geowebcache/web/src/main/webapp/
    ...
    Suppressed: java.lang.RuntimeException: Error scanning entry org/geowebcache/swift/SwiftUploadTask.class from jar file:///Users/jgarnett/.m2/repository/org/geowebcache/gwc-swift/1.28-SNAPSHOT/gwc-swift-1.28-SNAPSHOT.jar
        at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0 (AnnotationParser.java:882)
        at java.util.TreeMap$ValueSpliterator.forEachRemaining (TreeMap.java:3215)
        at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:762)
        at org.eclipse.jetty.annotations.AnnotationParser.parseJar (AnnotationParser.java:874)
        at org.eclipse.jetty.annotations.AnnotationParser.parse (AnnotationParser.java:838)
        at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call (AnnotationConfiguration.java:163)
        at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run (AnnotationConfiguration.java:471)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:765)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:683)
        at java.lang.Thread.run (Thread.java:840)
    Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61

I am running Java 17, so something is odd:

Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: /Users/jgarnett/.sdkman/candidates/maven/current
Java version: 17.0.15, vendor: Eclipse Adoptium, runtime: /Users/jgarnett/.sdkman/candidates/java/17.0.15-tem
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "15.5", arch: "aarch64", family: "mac"

@groldan groldan force-pushed the geoserver3/java17 branch from 401ed5d to 101c362 Compare June 25, 2025 13:16
@groldan
Copy link
Member Author

groldan commented Jun 25, 2025

Hi @jodygarnett, good catch, didn't even thought about running mvn jettty:run :/
Should be fixed by 101c362

@jodygarnett
Copy link
Contributor

jodygarnett commented Jun 25, 2025

Thanks confirmed the fix worked, note I updated some docs while waiting for builds and so on as part of this PR.

Q: did you force push or anything? My doc changes and commit history seem to be troubled.

@groldan
Copy link
Member Author

groldan commented Jun 26, 2025

hi @jodygarnett , sorry about that I'm not used to direct changes to the pr and I'm pretty sure I rebased on top of main hence the force push

Copy link
Contributor

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look exhausting, thanks for the work Gabe. I have tested locally and update the docs.

@groldan groldan force-pushed the geoserver3/java17 branch from ca54fa8 to deb996a Compare June 27, 2025 14:33
<local name="message"/>
<property name="message" value="autobuild not available:${line.separator}
${line.separator}
virtualenv venv${line.separator}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this would work with Windows installations?

On a related note, I've just upgraded to the latest Linux Mint and it's the first distro where I'm basically forced to use virtualenvs, the previous release allowed me to use pip directly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why it wouldn't, it's just printing a message and using ${line.separator} for cross platform compatibility.

In any case I'm pretty sure that was Jody's contribution. @jodygarnett do you know if that'll work on windows?


1. Download an OpenJDK release for your platform:

* https://adoptium.net/temurin/releases/?version=11 Temurin 11 (LTS) (Recommended)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current link is still pointing at java 11 mind

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

defaultCount + 100,
getInfoNames(config).size());
// get a thread pool

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need for these two white lines... the comment refers to the code line below, if anything adding a white line makes it less readable. Maybe you added an annotation and then removed it, leaving an empty line behind?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

throws Exception {
SqliteConnectionManager connectionManager = new SqliteConnectionManager(poolSize, 10);
connectionManagersToClean.add(connectionManager);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another newline that I guess is not necessary

}
FileUtils.copyFile(seedFile, databaseFile);
// submitting the select tasks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And various more in this file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@aaime
Copy link
Member

aaime commented Jun 30, 2025

I pushed changes for the Assert.equals calls having arguments swapped (there's a quick fix for them in IntelliJ)

@groldan groldan force-pushed the geoserver3/java17 branch from 92239da to 3a8121f Compare July 8, 2025 22:17
@groldan
Copy link
Member Author

groldan commented Jul 8, 2025

Thanks, squash-merged and ready to merge.

@aaime
Copy link
Member

aaime commented Jul 9, 2025

Looks like none of my feedback was taken into consideration? Maybe it's just an oversight

* 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 <andrea.aime@gmail.com>
Co-authored-by: Jody Garnett <jody.garnett@gmail.com>
@groldan groldan force-pushed the geoserver3/java17 branch from 3a8121f to de648b8 Compare July 9, 2025 14:30
@groldan
Copy link
Member Author

groldan commented Jul 9, 2025

Looks like none of my feedback was taken into consideration? Maybe it's just an oversight

Hi Andrea, yes, definitely an oversight. It should be good now.

@groldan groldan merged commit 57bf196 into GeoWebCache:main Jul 9, 2025
9 checks passed
@groldan groldan deleted the geoserver3/java17 branch July 9, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants