Convert wildfly earBuild tasks to the smoke-test plugin#11417
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits intoMay 20, 2026
Merged
Convert wildfly earBuild tasks to the smoke-test plugin#11417gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
earBuild tasks to the smoke-test plugin#11417gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
Conversation
Adds a new included build `build-logic/` hosting a single subproject
`smoke-test` that exposes the `dd-trace-java.smoke-test-app` plugin.
The plugin contributes:
- `NestedGradleBuild` task type that runs a nested Gradle build via the
Gradle Tooling API. It pins the nested Gradle version (no committed
per-application wrappers), uses the configured Java toolchain for the
nested daemon, forwards artifact paths from the root build as
`-P<name>=<path>`, and redirects the nested `buildDir` via
`-PappBuildDir=<path>` so outputs land under the outer project's build
directory.
- `smokeTestApp` project extension with an `application { ... }` block
that registers the `NestedGradleBuild` task, wires it into every `Test`
task via `dependsOn` + a `jvmArgumentProvider` for the produced
artifact's system property. Consumers can also register
`NestedGradleBuild` directly when they need more control; the plugin
is a no-op until `application` or a manual registration is done.
- `projectJar(name, project)` helper that forwards a sibling project's
jar to the nested build through a resolvable `Configuration` (avoids
`evaluationDependsOn` and the cross-project access ordering issues).
The plugin is verified with JUnit 5 unit tests (`ProjectBuilder`) and
end-to-end tests that drive the Tooling API path through the Gradle Test
Kit with a temporary Kotlin-DSL test project.
`build-logic/settings.gradle.kts` references the existing
`gradle/libs.versions.toml` catalog (mirroring `buildSrc/`) so the
plugin can use the same library coordinates as the rest of the repo.
The Gradle libs Maven repository (`https://repo.gradle.org/gradle/libs-releases`,
scoped to `org.gradle:`) is added to the root build's `pluginManagement`
and to `gradle/repositories.gradle` so the Tooling API jar resolves.
Smoke-test modules with Spring Boot plugin versions incompatible with
Gradle 9 will use this plugin in follow-up PRs instead of a committed
Gradle 8 wrapper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
…14.5
Set conventions on `smokeTestApp`:
- `gradleVersion` defaults to `"8.14.5"` (Gradle 8 last release; pinned because
Spring Boot plugin pre-3.5 calls `Configuration.getUploadTaskName()`, removed
in Gradle 9).
- `javaLauncher` defaults to a JDK 21 toolchain (the version the root build
requires for its own Gradle 9 migration; standardising the nested daemon on
the same JDK avoids requiring an extra toolchain on dev machines and CI
runners).
Consumers that need a different JDK or Gradle version still override
explicitly. The inner build script is responsible for pinning the produced
bytecode level (`java { sourceCompatibility = JavaVersion.VERSION_1_8 }` or
similar) — Gradle adds `--release N` automatically when source/target differs
from the daemon JVM.
`JavaToolchainService` is now injected into the extension; this works in any
project where a `java*` (or related) plugin is applied. Smoke-test modules
already apply `gradle/java.gradle`, which applies `java`, so the convention
resolves on first read.
Public defaults exposed as `DEFAULT_NESTED_GRADLE_VERSION` and
`DEFAULT_NESTED_JAVA_VERSION` constants so the values are discoverable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4186dc2 to
ca93810
Compare
earBuild tasks to the smoke-test plugin
ca93810 to
e5f138f
Compare
…ugin
Switch the plugin sources and unit tests over to the typed
`org.gradle.kotlin.dsl` extension functions where they replace
`::class.java` boilerplate:
- `tasks.register(name, Type::class.java) { … }` → `tasks.register<Type>(name) { … }`
- `tasks.withType(Type::class.java).configureEach { … }` → `tasks.withType<Type>().configureEach { … }`
- `extensions.create("name", Type::class.java)` → `extensions.create<Type>("name")`
- `extensions.getByType(Type::class.java)` → `extensions.getByType<Type>()`
- `extensions.findByName("name")` (followed by `isInstanceOf`) → `extensions.findByType<Type>()`
- `project.plugins.apply(Plugin::class.java)` → `project.apply<Plugin>()` (PluginAware)
- `objects.newInstance(Type::class.java)` → `objects.newInstance<Type>()`
Also drop the six `captured*` local variables in `SmokeTestAppExtension.application` —
inside `tasks.register<NestedGradleBuild>(taskName) { … }` the outer extension's
properties are now reached via `this@SmokeTestAppExtension.<prop>` directly.
No behavioural change; the 9 plugin tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…plugin The wildfly and rum:wildfly-15 smoke tests built their EAR via an `Exec` task invoking the root `gradlew` with `JAVA_HOME=8` (or whatever the parent shell had). Once the root wrapper moved to Gradle 9, that pattern broke — Gradle 9 requires a JDK 17 daemon, which then can't load the JDK 8-targeted application. Swap both `earBuild` tasks for the `NestedGradleBuild` task type from the `build-logic:smoke-test` plugin so the nested EAR build runs on a Gradle 8.14.5 daemon with the Java 8 toolchain. `dd-trace-api.jar` is forwarded through the plugin's `projectJar(...)` helper. The surrounding wildfly orchestration (unzip the server zip, copy the EAR into `standalone/deployments`, `Test.dependsOn 'deploy'`) is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e5f138f to
2a63725
Compare
dougqh
approved these changes
May 19, 2026
Contributor
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Converts the two
earBuildtasks in the wildfly smoke tests to use theNestedGradleBuildtask type from the smoke-test plugin added in #11405:dd-smoke-tests/wildfly/build.gradle(spring-ear EAR)dd-smoke-tests/rum/wildfly-15/build.gradle(rum-ear EAR)Before, each module used an
Exectask that invoked the rootgradlewwithJAVA_HOME=8(or the parent shell'sJAVA_HOME) to run the nested EAR build.After, the nested EAR build runs through the Gradle Tooling API pinned to Gradle 8.14.5 on a Java 8 toolchain daemon, with
dd-trace-api.jarforwarded via the plugin'sprojectJar(...)helper. Surrounding orchestration (wildfly server unzip, EAR copy intostandalone/deployments,Test.dependsOn 'deploy') is unchanged.Motivation
Once the root build moves to Gradle 9 (which requires a JDK 17 daemon), the existing
Exec-based pattern can't run the EAR build on Java 8 anymore — the rootgradlewis the root Gradle's wrapper, not the nested project's.Same problem and shape as PR #11379 "Pattern B" (existing
application/subprojects with a root-gradlewExec), but pointed at the smoke-test plugin'sNestedGradleBuildtask instead of a committed Gradle 8 wrapper inside eachapplication/subdir. The plugin uses the Tooling API to download/cache Gradle 8.14.5 once per host, so nothing new is committed to source control.Note
NestedGradleBuildhas a convention of running Gradle 8.14.5, with a daemon running on Java 21, so it's not explicitly set. It's configurable if needed.Additional Notes
spring-ear/andrum-ear/subprojects are untouched.earBuildtasks succeed; the previously-failing./gradlew assemblenow passes end-to-end.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labels🤖 Generated with Claude Code