Skip to content

Commit dd89925

Browse files
committed
fix(ci): exclude rollbar-java-agent on JDKs older than 17
1 parent 8808df7 commit dd89925

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

rollbar-java-agent/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ Exactly one event is recorded per connection, even when your code hits several o
3131

3232
## Requirements
3333

34-
- Java 11 or higher
34+
- Java 11 or higher **to run** the agent
35+
- Java 17 or higher **to build** it from source — the shadow plugin that packages the fat JAR
36+
requires a Java 17+ JVM, so on an older JDK the module is excluded from the build entirely and
37+
`:rollbar-java-agent` tasks fail as unknown. The JAR it produces still targets Java 11.
3538
- `rollbar-java` on the application classpath (for `Rollbar.init(...)`)
3639

3740
The agent bundles only ByteBuddy, under a relocated package name. It does **not** bundle the

settings.gradle.kts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,17 @@ if (isJava8 || isJava11) {
6868
include(":rollbar-android", ":examples:rollbar-android")
6969
}
7070

71-
if (isJava8) {
72-
println("Java 8 detected: excluding :rollbar-java-agent (requires Java 11+)")
71+
// The agent's own artifact targets Java 11+ (JavaCompile release = 11), but *building* it needs a
72+
// Java 17+ JVM: it is packaged by com.gradleup.shadow 9.x, whose plugin marker declares a JVM 17
73+
// runtime requirement, so on an older JVM the build fails while resolving the plugin classpath —
74+
// before any task runs. Shadow 9.x is not optional here (Byte Buddy 1.18 ships Java 24 class files
75+
// under META-INF/versions/24, which earlier shadow releases cannot read), and a Java toolchain does
76+
// not help because the plugin is resolved against the Gradle daemon's JVM, not the toolchain.
77+
//
78+
// So exclude the module on Java 8 and 11. The CI matrix still builds and tests it on 17, and the
79+
// release job runs on 17.
80+
if (JavaVersion.current() < JavaVersion.VERSION_17) {
81+
println("Java ${JavaVersion.current()} detected: excluding :rollbar-java-agent (building it requires Java 17+)")
7382
} else {
7483
include(":rollbar-java-agent")
7584
}

0 commit comments

Comments
 (0)