jrepp opened a new pull request, #3283:
URL: https://github.com/apache/tinkerpop/pull/3283
## Summary
This PR enables building TinkerPop with Java 25 by addressing two key
compatibility issues:
1. **Groovy ASM Version**: Updated to Groovy 4.0.30-SNAPSHOT which includes
ASM 9.9 (required for Java 25 class file major version 69)
2. **Annotation Processor Classloading**: Added explicit
`annotationProcessorPaths` configuration for the `GremlinDslProcessor`
## Background
Java 25 introduces class file version 69, which requires ASM 9.7+ for
bytecode analysis. The standard Groovy 4.0.25 bundles an older ASM that only
supports up to Java 24 (class file version 68), causing:
```
java.lang.IllegalArgumentException: Unsupported class file major version 69
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:200)
```
Additionally, Java 25 has stricter classloader isolation that prevents
annotation processors from automatically discovering their dependencies on the
compile classpath.
## Changes
### `pom.xml`
- Updated `groovy.version` from `4.0.25` to `4.0.30-SNAPSHOT`
### `gremlin-groovy/pom.xml`
- Added `annotationProcessorPaths` to `maven-compiler-plugin` configuration
containing:
- `gremlin-annotations` (the processor itself)
- `gremlin-core` (required by processor for `GraphTraversal.Admin` etc.)
- `gremlin-shaded`, `gremlin-language` (transitive dependencies)
- `javapoet` (code generation library used by processor)
- `antlr4-runtime` (transitive dependency)
## Build Requirements
To build with Java 25:
```bash
mvn clean install -DskipTests -Denforcer.skip=true -Dmaven.javadoc.skip=true
```
**Prerequisites:**
- Local installation of Groovy 4.0.30-SNAPSHOT with ASM 9.9 support
- The Groovy build requires: `cd groovy && ./gradlew publishToMavenLocal`
**Required flags:**
| Flag | Reason |
|------|--------|
| `-Denforcer.skip=true` | Bypasses `[11,18)` Java version restriction |
| `-Dmaven.javadoc.skip=true` | Avoids javadoc errors with Groovy source
paths |
## Trade-offs and Considerations
### For Maintainers
1. **Groovy Dependency**: This PR uses a SNAPSHOT version of Groovy. For
production, we should:
- Wait for an official Groovy 4.0.x release with ASM 9.9
- Or pin to a specific Groovy version once available
2. **Annotation Processor Path**: The explicit `annotationProcessorPaths`
configuration is more verbose but provides better isolation and explicit
dependency management. This is actually a **recommended practice** for Maven
3.5+ and works correctly on all Java versions.
3. **Enforcer Plugin**: The Java version restriction `[11,18)` in the
enforcer plugin will need to be updated to support Java 25+ officially.
4. **Javadoc Generation**: Javadoc generation has path issues with
Groovy-compiled sources. This is a pre-existing issue that becomes more
apparent with stricter Java 25 tooling.
### What This PR Does NOT Change
- No changes to source code
- No changes to test behavior
- No changes to runtime behavior
- Backward compatible with Java 11-24
## Test Plan
- [x] Full `mvn clean install -DskipTests` succeeds
- [x] All 32 modules build successfully
- [ ] Run full test suite (pending)
- [ ] Verify on CI with Java 25
## Related Work
This PR works in conjunction with a custom Groovy 4.0.30-SNAPSHOT build that
includes:
- ASM 9.9 for Java 25 class file support
- Gradle 9.x compatibility updates
- Various build fixes for Java 25
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]