Skip to content

Pin Maven to 3.8.8 for Java 11 compatibility#104

Merged
ruhan1 merged 2 commits intoCommonjava:masterfrom
ruhan1:fix-java17-build-tooling
Feb 4, 2026
Merged

Pin Maven to 3.8.8 for Java 11 compatibility#104
ruhan1 merged 2 commits intoCommonjava:masterfrom
ruhan1:fix-java17-build-tooling

Conversation

@ruhan1
Copy link
Contributor

@ruhan1 ruhan1 commented Feb 4, 2026

Summary

Explicitly installs Maven 3.8.8 in GitHub Actions to maintain Java 11 compatibility with Datastax Cassandra Driver 3.x dependency.

Problem

Since GitHub Actions ubuntu-latest switched to Ubuntu 24.04 (on Jan 17, 2025), PR builds started failing with:

Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.6.9:generate-code
The plugin has unmet prerequisites: Required Java version 17 is not met by current version: 11.0.30

Root Cause:

  • Maven 3.9.0+ (released March 2023) introduced strict enforcement of Java prerequisites for Maven plugins
  • quarkus-maven-plugin:3.6.9 binary was compiled with/requires Java 17 when used with Maven 3.9.x
  • Both ubuntu-latest (24.04) and ubuntu-22.04 now ship with Maven 3.9.x

Why Not Upgrade to Java 17?

The codebase uses Datastax Cassandra Driver 3.7.2 (transitive dependency from path-mapped-pathdb-datastax:3.0) which only supports Java 8-11:

NullPointerException: Cannot invoke "Object.equals(Object)" because "clazz" is null
    at com.datastax.driver.mapping.DefaultPropertyMapper.scanMethodAnnotations

Upgrading to Datastax Driver 4.x (which supports Java 17) would require significant migration effort with package name and API changes (com.datastax.cassandracom.datastax.oss.driver).

Solution

Explicitly install Maven 3.8.8 (the last version before 3.9.0) in GitHub Actions workflows. Maven 3.8.x doesn't enforce plugin Java prerequisites, allowing the build to work with Java 11.

Changes:

  • Added stCarolas/setup-maven@v4.5 action to install Maven 3.8.8 before builds
  • Kept runs-on: ubuntu-22.04 for consistency

This minimal change:

  • ✅ Fixes PR build failures
  • ✅ Maintains Java 11 runtime compatibility
  • ✅ Requires no code changes
  • ✅ Keeps existing dependency versions

Future Consideration

When ready to migrate to Datastax Driver 4.x, remove the Maven version pin and upgrade to Java 17.

🤖 Generated with Claude Code

The ubuntu-latest runner switched from Ubuntu 22.04 to Ubuntu 24.04
on Jan 17, 2025, which includes Maven 3.9.12. Maven 3.9.6+ enforces
stricter Java prerequisites for plugins.

While quarkus-maven-plugin 3.6.9 requires Java 17 to execute, our
codebase uses Datastax Cassandra Driver 3.7.2 (from path-mapped-storage)
which only supports Java 8-11. Upgrading to Datastax Driver 4.x would
be a major migration.

Pinning to ubuntu-22.04 keeps us on an older Maven version that doesn't
enforce the plugin Java requirement as strictly, allowing builds to
continue on Java 11.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ruhan1 ruhan1 force-pushed the fix-java17-build-tooling branch from 3fc1fdd to 2f4fc3d Compare February 4, 2026 08:24
@ruhan1 ruhan1 changed the title Update build tooling to Java 17 Pin GitHub Actions to ubuntu-22.04 for Java 11 compatibility Feb 4, 2026
Maven 3.9.0+ enforces stricter Java prerequisites for plugins.
The quarkus-maven-plugin:3.6.9 requires Java 17 to execute when
used with Maven 3.9.x, even though it's compiled for Java 11.

Maven 3.8.8 (last pre-3.9 version) doesn't enforce this check,
allowing the build to work with Java 11.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ruhan1 ruhan1 changed the title Pin GitHub Actions to ubuntu-22.04 for Java 11 compatibility Pin Maven to 3.8.8 for Java 11 compatibility Feb 4, 2026
@ruhan1 ruhan1 merged commit 721bb3d into Commonjava:master Feb 4, 2026
1 check passed
@ruhan1 ruhan1 deleted the fix-java17-build-tooling branch February 4, 2026 08:48
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.

1 participant