Skip to content

Require Java 21 and upgrade to Lucene 10.6.0 and Derby 10.17.1.0 - #261

Merged
mraible merged 4 commits into
apache:masterfrom
mraible:java-21-lucene-10
Nov 15, 2026
Merged

mraible merged 4 commits into
apache:masterfrom
mraible:java-21-lucene-10

Conversation

@mraible

@mraible mraible commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Roller 7.0 now requires Java 21. Lucene 10 and Derby 10.17 are compiled for it, and Derby 10.17.1.0 fixes CVE-2022-46337. Derby is only used by tests, jetty:run and db-utils.

Java 21:

  • The compiler release is 21 in the root pom and it-playwright.
  • CI builds on JDK 21 and 25. The dev-build upload, license, UI-test and CodeQL jobs use 21.
  • The Dockerfile uses maven:3.9.16-eclipse-temurin-21 and tomcat:11.0.29-jdk21-temurin, pinned instead of the old floating tags.
  • README, CHANGES.md and the install guide say Java 21. The install guide's other prerequisites (Java EE 6, Servlet 2.4, Tomcat 8, Jetty 9, JPA 2.0, the 6.0.0 archive names) are brought up to date too.

Lucene 9.12.3 → 10.6.0:

  • IndexSearcher.doc() is gone. Results now read stored fields through searcher.storedFields(), fetched on the thread that reads them.
  • TotalHits.value became value(). The exact total and the search.results.max cap behave as before; SearchResultLimitTest still passes.
  • Existing indexes. Lucene 10 opens a Roller 6.1.7 index through backward-codecs. A 6.1.0–6.1.6 index is rebuilt because of its removed fields, as 6.1.7 already did. Roller 6.0's Lucene 8 index throws IndexFormatTooOldException. Master already caught that and scheduled a rebuild, but left no index behind, so searches failed until the rebuild finished. Now an empty index is created right away, and the log gets one line instead of a stack trace.
  • IndexUpgradeTest covers this with real fixtures written by Lucene 8.3.0 and 9.12.3 using Roller 6.0's and 6.1.7's fields. CHANGES.md and the install guide say no operator action is needed.

Derby 10.16.1.1 → 10.17.1.0 needed no setup changes. The dependencies and the classes Roller uses are in the same jars.

mvn clean install passes on JDK 21 and JDK 25: 661 tests, 2 new.

Roller 7 now requires Java 21. The compiler release in the root and Playwright poms, the CI matrix (JDK 21 and 25, dropping 17), the other CI jobs, CodeQL, the Docker base images, the README, the install guide and CHANGES.md all move from 17 to 21. There was no code that existed only to support older Java, so none is removed.

Java 21 allows two upgrades that need it:

- Lucene 9.12.3 to 10.6.0 for every Lucene artifact. Lucene 10 removed IndexSearcher.doc(int), so search results read stored fields through IndexSearcher.storedFields(), fetched on the request thread that reads them. TotalHits is now a record, so the count comes from value() and relation(). The tests use MatchAllDocsQuery.INSTANCE in place of its deprecated constructor. The exact total hit count and the search.results.max cap behave as before, and their tests pass unchanged apart from the accessor calls.
- Derby 10.16.1.1 to 10.17.1.0, which fixes CVE-2022-46337. Its artifacts and their dependencies are the same as in 10.16, so the test, jetty:run and db-utils setup needs no change. Derby is not in the WAR.

Lucene 10 reads Roller 6.1's Lucene 9 index through lucene-backward-codecs, but not Roller 6.0's Lucene 8 index. Roller already deleted an index it could not open and rebuilt it in the background, but until the rebuild wrote one there was no index, so a search in that window failed. Roller now creates an empty index first, as it does for a missing index or one with removed fields, and logs a one-line warning without a stack trace when the format is too old or too new.

IndexUpgradeTest starts Roller's index manager on a Lucene 8.3.0 index with Roller 6.0's fields and on a Lucene 9.12.3 index with Roller 6.1.7's fields. The first is replaced and rebuilt, and the second is kept, searched and written to. The zipped fixtures are excluded from test resource filtering. CHANGES.md and the install guide's upgrade section describe what happens to an existing index.
The prerequisites still named Java EE 6, Servlet 2.4, Tomcat 8, Jetty 9, JPA 2.0 and the roller-release-6.0.0-standard archives. Roller 7 needs a Servlet 6.1 container; CI tests it on Jetty 12 (EE 11) and the Docker image on Tomcat 11. The binary archives are apache-roller-<version>-binary.
Lucene 9 can't read an index Lucene 10 has written. Roller 6.1.7 treats that as an unreadable index: it deletes it and rebuilds in the background, but creates no empty index first, so searches fail until the rebuild finishes.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR-Review: no issues. CI is green, and the new install-guide lines cover going back to 6.1.x.

@mraible
mraible merged commit f6f025e into apache:master Nov 15, 2026
9 checks passed
@mraible
mraible deleted the java-21-lucene-10 branch November 15, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants