You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "jamesfredley (via GitHub)" <gi...@apache.org> on 2026/01/30 15:24:04 UTC

[PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

jamesfredley opened a new pull request, #15365:
URL: https://github.com/apache/grails-core/pull/15365

   ## Summary
   
   This PR upgrades the Grails build infrastructure to use Gradle 9.3.1 and upgrades the grails-forge module to Micronaut 4.
   
   ## Changes
   
   ### Gradle 9.3.1 Upgrade
   
   - Update Gradle wrapper from 8.14.4 to 9.3.1 across all modules
   - Fix deprecated Gradle APIs:
     - Replace `convention` with `extensions` API
     - Replace `ConfigureUtil` with `ClosureBackedAction`
     - Replace `JavaPluginConvention` with `JavaPluginExtension`
     - Replace `outputFile` with `destinationFile` in `WriteProperties`
   - Add JUnit Platform launcher dependency required by Gradle 9 for test execution
   - Update `.sdkmanrc` to reference Gradle 9.3.1
   
   ### Micronaut 4 Upgrade (grails-forge)
   
   - Upgrade Micronaut from 3.10.4 to 4.10.7
   - Upgrade Groovy from 3.x to 4.0.30
   - Upgrade Spock from 2.1-groovy-3.0 to 2.3-groovy-4.0
   - Migrate `javax.*` to `jakarta.*` validation annotations:
     - `javax.validation.constraints.*` → `jakarta.validation.constraints.*`
     - `javax.transaction.*` → `jakarta.transaction.*`
   - Update dependency coordinates:
     - `org.codehaus.groovy` → `org.apache.groovy`
     - `io.micronaut:micronaut-bom` → `io.micronaut.platform:micronaut-platform`
     - `javax.inject:javax.inject` → `jakarta.inject:jakarta.inject-api`
   - Add `micronaut-validation-processor` for annotation processing
   - Add `micronaut-jackson-databind` runtime dependency
   - Add `@Validated` annotation to controllers using validation
   - Remove explicit shadow plugin (now provided by micronaut-application plugin)
   
   ### Test Infrastructure Updates
   
   - Add ByteBuddy dependency for Spock mocking on Java 17+ (CGLIB doesn't support Java 17 class files)
   - Add `--add-opens java.base/java.lang=ALL-UNNAMED` JVM arg for test execution
   - Update Coherence BOM license mapping for version 25.03.2
   
   ## Testing
   
   - [x] grails-forge-web-netty starts successfully and displays Micronaut 4 banner
   - [x] Application starts on configured port
   
   ## Breaking Changes
   
   None expected for end users. This is an internal build infrastructure upgrade.
   
   ## Related Issues
   
   Part of the ongoing effort to keep Grails on the latest stable versions of its dependencies.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3825219117

   All the BOM and build-logic plugins are working correctly:
   - ✅ grails-bom:extractConstraints - SUCCESS
   - ✅ grails-bom:build - SUCCESS  
   - ✅ grails-gradle-bom:build - SUCCESS
   - ✅ build-logic:build - SUCCESS


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4165700998

   ## 🔎 No tests executed 🔎
   
   🏷️ Commit: 6949ed3cc931c5481073b7d9627d44b0c747513f
   ▶️ Tests:  0 executed
   ⚪️ Checks: 0/0 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3130770355


##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   It's more about performance in this case - don't do the lookup unless we actually run it.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3142273395


##########
grails-forge/grails-forge-core/build.gradle:
##########
@@ -41,13 +41,15 @@ sourceSets {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
+    implementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
     annotationProcessor 'io.micronaut:micronaut-inject-java'
-    testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
+    testAnnotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
     testAnnotationProcessor 'io.micronaut:micronaut-inject-java'
 
-    api platform("io.micronaut:micronaut-bom:$micronautVersion") // TODO: Should this be api?
+    api platform("io.micronaut.platform:micronaut-platform:$micronautVersion") // TODO: Should this be api?
+    api "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"

Review Comment:
   Done in 9f4831fa47. Dropped the `:$jacksonDatabindVersion` coordinate. The micronaut-platform 4.10.10 BOM already imported on the line above pulls jackson-bom transitively, which manages `jackson-databind`. Resolved version: `com.fasterxml.jackson.core:jackson-databind -> 2.19.2` (one minor newer than the previously hard-coded 2.18.3).
   
   Left `jacksonDatabindVersion=2.18.3` in `grails-forge/gradle.properties` because `grails-forge/buildSrc/build.gradle` still references it on its own gradle-plugin compile classpath, where no BOM is imported. Happy to tackle that separately if you want it cleaned up too.
   
   Assisted-by: claude-code:claude-opus-4-7
   



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4320081974

   So we did say we would pick the newer versions, and since we have a mismatch the change makes sense.  I will review the PR next


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3089274706


##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextCommandTask.groovy:
##########
@@ -20,7 +20,13 @@ package org.grails.gradle.plugin.commands
 
 import groovy.transform.CompileStatic
 
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ProviderFactory
 import org.gradle.api.tasks.JavaExec
+import org.gradle.jvm.toolchain.JavaToolchainService
+import org.gradle.process.internal.ExecActionFactory
+

Review Comment:
   Fixed. The unused imports (ObjectFactory, ProviderFactory, JavaToolchainService, ExecActionFactory) were already removed in a subsequent commit - no action needed.



##########
grails-forge/gradle/test-config.gradle:
##########
@@ -17,6 +17,13 @@
  *  under the License.
  */
 
+// Add JUnit Platform launcher dependency required by Gradle 9 for running tests
+// Also add ByteBuddy for Spock mocking on Java 17+ (CGLIB doesn't support Java 17 class files)
+dependencies {
+    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

Review Comment:
   Fixed. Added explicit version \1.12.2\ to \junit-platform-launcher\.



##########
.sdkmanrc:
##########
@@ -2,5 +2,5 @@
 java=17.0.18-librca
 # Keep gradle version synced with gradle.properties (gradleToolingApiVersion), all gradle-wrapper.properties files,

Review Comment:
   Fixed. Updated the comment to reference the gradle-bootstrap project for propagating the version to all wrapper files.



##########
grails-gradle/bom/build.gradle:
##########
@@ -43,8 +43,9 @@ dependencies {
         exclude group: 'com.fasterxml.jackson'
     }
 
-    // Because gradle uses groovy 3, we must use groovy 3 compatible versions for the grails-gradle-bom
-    api platform("org.codehaus.groovy:groovy-bom:${GroovySystem.version}")
+    // Use Gradle's embedded Groovy version for the grails-gradle-bom
+    // Groovy 4+ uses org.apache.groovy coordinates
+    api platform("org.apache.groovy:groovy-bom:${GroovySystem.version}")

Review Comment:
   Fixed. Extracted the Groovy version into \gradleBomDependencyVersions\ as \gradle-groovy.version: 4.0.31\ and added a \gradle-groovy-bom\ entry to \gradleBomPlatformDependencies\. The bom/build.gradle now references \gradleBomPlatformDependencies['gradle-groovy-bom']\ instead of \GroovySystem.version\.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3824320617

   * The SBOM plugin needs updated as part of upgrading to Gradle 9.
   * How are you working around the configuration cache?  Are you just disabling it?  It's my understanding plugins like asciidoctor cause issues with it unless you disable.  If we update, it should work.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3142224362


##########
grails-forge/grails-forge-analytics-postgres/build.gradle:
##########
@@ -18,7 +18,6 @@
  */
 
 plugins {
-    id 'com.gradleup.shadow'
     id 'org.apache.grails.buildsrc.properties'

Review Comment:
   Verified safe to keep removed.
   
   The `io.micronaut.application` 4.6.2 plugin owns the assembly lifecycle for this module (`assemble`, `dockerfile`, `dockerfileNative`, `dockerBuild`, `dockerBuildNative`). CI deploys `grails-forge-analytics-postgres` via `dockerBuildNative` (native image), not `shadowJar` - confirmed by grepping the deploy workflows: `forge-deploy-{next,prev,prev-snapshot,release,snapshot}.yml` all run `./gradlew grails-forge-analytics-postgres:test` and `grails-forge-analytics-postgres:dockerBuildNative`, none of them invoke `shadowJar`.
   
   The shadow plugin is still explicitly applied where it actually produces a fat jar (`grails-cli`, `grails-cli-shadow`).
   
   Verified locally: `gradle :grails-forge-analytics-postgres:assemble :grails-forge-analytics-postgres:dockerfile :grails-forge-analytics-postgres:dockerfileNative` all succeed without the shadow plugin.



##########
grails-forge/grails-forge-api/build.gradle:
##########
@@ -47,8 +48,8 @@ dependencies {
     api 'io.micronaut:micronaut-http-client'
     api 'io.micronaut:micronaut-inject'
     api 'io.micronaut:micronaut-runtime'
-    api 'io.micronaut:micronaut-validation'
-    api group: 'javax.inject', name: 'javax.inject', version: '1'
+    api 'io.micronaut.validation:micronaut-validation'
+    api "jakarta.inject:jakarta.inject-api:$jakartaInjectVersion"

Review Comment:
   Done in dae431d4a1. Dropped the explicit `:$jakartaInjectVersion` from `grails-forge-api` (this file) and `grails-forge-cli`, and removed `jakartaInjectVersion=2.0.1` from `grails-forge/gradle.properties`.
   
   The micronaut-platform 4.10.10 BOM (already imported in both modules via `platform("io.micronaut.platform:micronaut-platform:$micronautVersion")`) manages `jakarta.inject:jakarta.inject-api` transitively through `io.micronaut:micronaut-core:4.10.18`. Verified with `gradle :grails-forge-api:dependencies --configuration compileClasspath` -> resolves to 2.0.1, the same value we were previously hard-coding. So no version mismatch with the BOM, and future Micronaut bumps keep jakarta-inject in sync automatically.



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -968,12 +975,17 @@ ${importStatements}
     @CompileDynamic
     protected TaskProvider<Task> createNative2AsciiTask(TaskContainer tasks, src, dest) {
         TaskProvider<Task> native2asciiTask = tasks.register('native2ascii').configure {
+            it.inputs.dir(src)
+            it.outputs.dir(dest)
+
+            // Capture ant builder at configuration time to avoid Task.project access at execution time

Review Comment:
   Done in 5d21fc3a39 (also dropped the second `// See: ...` doc-link line).



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy:
##########
@@ -87,9 +87,14 @@ class GrailsProfileGradlePlugin implements Plugin<Project> {
         project.configurations.named('runtimeElements')
                 .configure { it.extendsFrom(runtimeOnlyConfiguration.get()) }
 
-        TaskProvider<Task> processProfileResourcesTask = project.tasks.register('processProfileResources')
-        processProfileResourcesTask.configure { Task task ->
+        // Use Sync task type instead of project.sync in doLast to avoid Task.project access at execution time

Review Comment:
   Done in 5d21fc3a39 (also dropped the second `// See: ...` doc-link line).



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -45,3 +41,61 @@ apply {
     from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Root-cause fix for duplicate META-INF/spring-configuration-metadata.json:
+//
+// This plugin intentionally exposes both a Java bean (PluginJavaMicronautBean) and a
+// Groovy bean (PluginGroovyMicronautBean) that share the @ConfigurationProperties('my')
+// prefix to exercise the original issue 11767 scenario. As a side effect, two different
+// Micronaut tools produce the same metadata file:
+//   - micronaut-inject-java runs as a Java annotation processor during compileJava and
+//     writes build/classes/java/main/META-INF/spring-configuration-metadata.json
+//     describing PluginJavaMicronautBean.
+//   - micronaut-inject-groovy (pulled in transitively via grails-micronaut) runs as a
+//     Groovy AST transform during compileGroovy and writes
+//     build/classes/groovy/main/META-INF/spring-configuration-metadata.json describing
+//     PluginGroovyMicronautBean.
+// The two files are not equivalent: each describes the beans visible to its own compiler.
+// The shared CompilePlugin convention sets jar.duplicatesStrategy = FAIL so the build
+// surfaces any double-configuration. Here the duplicate is by design, so we merge the
+// two JSON documents into a single file (preserving every group / property / hint) and
+// remove the now-merged source so the jar task sees exactly one metadata file. This is
+// preferable to dropping one of the documents (DuplicatesStrategy.EXCLUDE) because that
+// would silently lose the bean type information for one of the languages.
+def mergeMicronautConfigMetadata = tasks.register('mergeMicronautConfigMetadata') {
+    description = 'Merges the spring-configuration-metadata.json emitted separately by ' +
+            'micronaut-inject-java and micronaut-inject-groovy into one combined document.'
+    group = 'build'
+
+    def metadataRelativePath = 'META-INF/spring-configuration-metadata.json'
+    def javaMetadataProvider = layout.buildDirectory.file("classes/java/main/${metadataRelativePath}")
+    def groovyMetadataProvider = layout.buildDirectory.file("classes/groovy/main/${metadataRelativePath}")
+
+    // Re-run whenever either compile step emits new metadata; the task mutates files
+    // inside the compile output directories so we cannot rely on standard up-to-date
+    // tracking. The work is cheap (two small JSON files) so always running is acceptable.
+    outputs.upToDateWhen { false }

Review Comment:
   Refactored properly in d9a218175a.
   
   The merge task now:
   
   - Writes to a new `build/merged-spring-configuration-metadata/` directory instead of mutating compile outputs.
   - Declares `inputs.files(provider { ... })` filtered to existing files at execution time, plus an `outputs.file(...)` and `outputs.cacheIf { true }` so Gradle can cache it.
   - `dependsOn compileJava, compileGroovy` so the compile output dirs always populate before the merge runs.
   - The `jar` task uses an `eachFile` filter to drop the per-compiler copies but keep the merged copy (a global `exclude` would have discarded the merged document too).
   
   Verified:
   
   - A second `gradle :grails-test-examples-plugins-issue-11767:jar` invocation reports `compileJava`, `compileGroovy`, `mergeMicronautConfigMetadata` and `jar` all UP-TO-DATE - the always-rerun behavior is gone.
   - The produced jar contains exactly one `META-INF/spring-configuration-metadata.json` with both `PluginJavaMicronautBean` and `PluginGroovyMicronautBean` entries merged (groups + properties).
   - Consumer app (`:grails-test-examples-issue-11767:compileGroovy`) still compiles cleanly.
   
   Also dropped the long block comment - the inline 7-line summary above the task is enough.



##########
grails-forge/test-core/build.gradle:
##########
@@ -59,15 +59,15 @@ dependencies {
         testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"
     }
 
-    testImplementation "org.codehaus.groovy:groovy:$groovyVersion"
+    testImplementation "org.apache.groovy:groovy:$groovyVersion"

Review Comment:
   Fixed properly in 014355310b.
   
   - `groovyVersion=4.0.31` removed from `grails-forge/gradle.properties`.
   - All 16 `:$groovyVersion` references across forge dropped (`test-core`, `grails-forge-api`, `grails-forge-cli`, `grails-forge-core`, `gradle/doc-config.gradle`).
   - The `eachDependency { details.useVersion(groovyVersion) }` resolutionStrategy override removed from `grails-forge-api`, `grails-forge-cli`, and `grails-forge-core`. The `spock-core` override stays - that one is still needed because the micronaut-platform BOM's spock version differs from ours.
   
   With the override gone, Gradle's conflict resolution lets the BOM-managed version win:
   
   `org.apache.groovy:groovy-bom` -> 4.0.28, `org.apache.groovy:groovy` -> 4.0.28, `org.apache.groovy:groovy-test` -> 4.0.28.
   
   Forge now tracks the Groovy version Micronaut 4.10.10 was actually built against (4.0.28). grails-core stays on 4.0.31 - the two builds are independent composite projects with their own platform choices. Verified with `gradle :grails-forge-api:dependencies --configuration testRuntimeClasspath` and `gradle :grails-forge-{api,cli,core,test-core}:compileTestGroovy`.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4255389633

   Addressed all review comments and the three big issues from the review body:
   
   **Inline comments (all resolved):**
   - Unused imports: already cleaned up in a prior commit
   - junit-platform-launcher: added explicit version 1.12.2
   - .sdkmanrc: updated comment to reference gradle-bootstrap project
   - Groovy version: extracted to gradleBomDependencyVersions map, bom references gradleBomPlatformDependencies['gradle-groovy-bom']
   - GrailsProfileGradlePlugin inputs: restored the 4 inputs.dir().optional().skipWhenEmpty() declarations
   - issue-11767 compileJava: disabled compileJava instead of the JSON metadata merge hack
   - CycloneDX: upgraded from 2.4.1 to 3.0.0, rewrote SbomPlugin for CyclonedxDirectTask API
   - SbomPlugin providers: converted isReproducibleBuild and buildDate to lazy Provider types
   
   **Big Issue 1 - Gradle 9 blockers in grails-gradle plugins:**
   - GrailsExtension: replaced removed ConfigureUtil.configure() with ClosureBackedAction
   - GrailsPluginGradlePlugin: migrated project.task(type: Copy, ...) to tasks.register(...)
   - GrailsGradlePlugin: migrated project.tasks.create('buildProperties') to tasks.register(...)
   
   **Big Issue 2 - Configuration cache:**
   - Explicitly set org.gradle.configuration-cache=false in gradle.properties with reference to #15497
   
   **Big Issue 3 - ExtractDependenciesTask:**
   - Removed all project access from execution time (@TaskAction and populatePlatformDependencies)
   - Added captureProjectServices() method to capture DependencyHandler and ConfigurationContainer at configuration time
   - Moved the java-platform plugin check from doFirst to configuration time in the task registration site
   - Note: still creates detached configurations at execution time (incompatible with configuration cache), but this is acceptable since configuration cache is explicitly disabled


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4256622669

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 4c028a8f6a4247f844867c9779bb2a04f5421d15
   ▶️ Tests:  34509 executed
   ⚪️ Checks: 34/34 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4261200308

   ## CI Fix Pushed (237527b)
   
   Two root-cause fixes for the failing checks:
   
   ### 1. `Build Grails-Core` / `build_grails` - compile failure on `:grails-test-examples-issue-11767:compileGroovy`
   
   The previous attempt to resolve the duplicate `META-INF/spring-configuration-metadata.json` in the `issue-11767` plugin disabled `compileJava` outright. That broke the consumer app: `grails-test-examples/issue-11767/AppController.groovy` imports `issue11767.plugin.PluginJavaMicronautBean`, a real Java class, so `compileGroovy` could no longer resolve the type.
   
   **Root cause of the metadata duplicate:** both tools correctly emit non-overlapping metadata for the beans visible to their own compiler:
   
   - `micronaut-inject-java` (annotation processor, `compileJava`) writes `build/classes/java/main/META-INF/spring-configuration-metadata.json` describing `PluginJavaMicronautBean`.
   - `micronaut-inject-groovy` (AST transform, `compileGroovy`, pulled in transitively via `grails-micronaut`) writes `build/classes/groovy/main/META-INF/spring-configuration-metadata.json` describing `PluginGroovyMicronautBean`.
   
   Both files are intentional for this fixture - it exists specifically to exercise Java + Groovy beans sharing `@ConfigurationProperties('my')`. `CompilePlugin` globally sets `jar.duplicatesStrategy = FAIL` to surface accidental double-configuration, so the build (correctly) refuses to silently pick one.
   
   **Fix:** a new `mergeMicronautConfigMetadata` task merges the two JSON documents (groups + properties + hints) into one file under `build/classes/groovy/main/META-INF/` and deletes the Java-side copy, so the jar task sees exactly one metadata file that describes both beans. No band-aid (`DuplicatesStrategy.EXCLUDE` would drop one bean's metadata; disabling a compile step would prevent consumers from using the class).
   
   Verified locally:
   
   ```
   ./gradlew :grails-test-examples-plugins-issue-11767:jar
   ./gradlew :grails-test-examples-issue-11767:compileGroovy
   ```
   
   Both succeed. `unzip -l` on the produced jar shows a single `META-INF/spring-configuration-metadata.json` containing both `PluginJavaMicronautBean` and `PluginGroovyMicronautBean` group entries and all four `my.value1` / `my.value2` property entries.
   
   ### 2. `Validate Dependency Versions` - OpenTelemetry 1.55.0 vs 1.59.0
   
   The PR bumped Selenium to `4.41.0`, which transitively requires `io.opentelemetry:*:1.59.x`. Spring Boot `4.0.5`'s BOM still manages `1.55.x`, so the shared dependency validator flagged every OpenTelemetry module in `grails-test-examples-scaffolding` (which pulls Selenium via Geb integration tests):
   
   ```
   io.opentelemetry:opentelemetry-api - resolved 1.59.0, expected 1.55.0
   io.opentelemetry:opentelemetry-context - resolved 1.59.0, expected 1.55.0
   ... (9 more)
   ```
   
   `dependencyInsight` confirmed the version bump originates from `org.seleniumhq.selenium:selenium-remote-driver:4.41.0`.
   
   **Fix:** import `io.opentelemetry:opentelemetry-bom:1.59.0` from `grails-bom` after `spring-boot-bom` so the grails-bom advertises the version that is actually resolved. `./gradlew validateDependencyVersions` now succeeds across every project.
   
   ### Files changed
   
   - `dependencies.gradle` - add `opentelemetry.version` and `opentelemetry-bom` platform import
   - `grails-test-examples/plugins/issue-11767/build.gradle` - remove the `compileJava` disable; add `mergeMicronautConfigMetadata` task with thorough root-cause comments


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r2746818407


##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextCommandTask.groovy:
##########
@@ -20,7 +20,13 @@ package org.grails.gradle.plugin.commands
 
 import groovy.transform.CompileStatic
 
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ProviderFactory
 import org.gradle.api.tasks.JavaExec
+import org.gradle.jvm.toolchain.JavaToolchainService
+import org.gradle.process.internal.ExecActionFactory
+

Review Comment:
   These Gradle types are imported but not used in this class (`ObjectFactory`, `ProviderFactory`, `JavaToolchainService`, `ExecActionFactory`). If you don’t need them for injection, please remove the unused imports to avoid compilation warnings or failures under stricter linting.



##########
grails-forge/gradle/test-config.gradle:
##########
@@ -17,6 +17,13 @@
  *  under the License.
  */
 
+// Add JUnit Platform launcher dependency required by Gradle 9 for running tests
+// Also add ByteBuddy for Spock mocking on Java 17+ (CGLIB doesn't support Java 17 class files)
+dependencies {
+    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

Review Comment:
   `testRuntimeOnly 'org.junit.platform:junit-platform-launcher'` is declared without a version. Since `gradle/test-config.gradle` is applied to projects like `grails-forge/test-core` that don’t use a platform/BOM providing JUnit Platform versions, dependency resolution will fail. Please either add an explicit version (or a version constraint), or import a JUnit BOM/platform that provides `junit-platform-launcher`.
   ```suggestion
       testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.2'
   ```



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4213661927

   I would like to see the Spring Boot 4 PR merged first and would like to finish reviewing this 


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3142241577


##########
dependencies.gradle:
##########
@@ -22,15 +22,16 @@
 // These files are split to facilitate separation of build vs application dependencies. These are the application dependencies.
 ext {
     gradleBomDependencyVersions = [
-            'ant.version'                   : '1.10.15',
+            'ant.version'                   : '1.10.17',
             'asciidoctor-gradle-jvm.version': '4.0.5',
             'asciidoctorj.version'          : '3.0.0',
             'asset-pipeline-gradle.version' : '5.1.0-M4',
-            'byte-buddy.version'            : '1.17.8',
-            'commons-text.version'          : '1.14.0',
+            'byte-buddy.version'            : '1.18.8',
+            'commons-text.version'          : '1.15.0',
             'directory-watcher.version'     : '0.19.1',
-            'gradle-spock.version'          : '2.3-groovy-3.0',
-            'grails-publish-plugin.version' : '0.0.4',
+            'gradle-groovy.version'         : '4.0.31',

Review Comment:
   Update: cc2f85fe07 broke `Validate Dependency Versions` in CI; reverting in the next commit and keeping `'4.0.31'` hard-coded.
   
   Reason: `GroovySystem.version` returns Gradle's *bundled* Groovy (4.0.29 for Gradle 9.4.1), not the version our build actually resolves. The grails-gradle plugin code transitively pulls Groovy 4.0.31 through grails-core, so:
   
   - BOM (`gradle-groovy.version` from `GroovySystem.version`) → 4.0.29
   - grails-gradle-plugins / grails-gradle-tasks resolve → 4.0.31
   - `validateDependencyVersions` flags every `org.apache.groovy:*` artifact as `resolved 4.0.31, expected 4.0.29` and fails the build.
   
   For the BOM-vs-resolved validator to be happy we need the published version to match what we actually use. Two ways to achieve that:
   
   1. Hard-code `gradle-groovy.version = '4.0.31'` (what the original PR did, what I'm reverting to).
   2. Force the entire grails-gradle composite to use Gradle's bundled Groovy (4.0.29), which would mean overriding grails-core's own Groovy version transitively. That cascades far past this PR's scope.
   
   Going with (1) for now. Open to revisiting if you'd prefer (2) or a different formulation - the trade-off is between "BOM tracks Gradle's bundled Groovy automatically" (your original ask) and "BOM matches what we actually publish/resolve" (what the validator enforces). They're in tension as long as Gradle's bundled Groovy lags grails-core's choice.
   
   Assisted-by: claude-code:claude-opus-4-7
   



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4257011464

   @jamesfredley Seems to be a compile failure.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4256107440

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 8eef136d69af5e4a7218e527335322ddb98ca848
   ▶️ Tests:  134 executed
   ⚪️ Checks: 33/33 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4261634934

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 237527bbe12df1ac7e3dcd5db547b99feb6f8006
   ▶️ Tests:  17699 executed
   ⚪️ Checks: 33/33 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3137473410


##########
.sdkmanrc:
##########
@@ -2,5 +2,5 @@
 java=17.0.18-librca
 # Keep gradle version synced with gradle.properties (gradleToolingApiVersion), all gradle-wrapper.properties files,

Review Comment:
   Confirmed still in place. `.sdkmanrc` now reads `Update the gradle-bootstrap project to propagate the version to all gradle-wrapper.properties files.` - resolving.



##########
grails-gradle/bom/build.gradle:
##########
@@ -43,8 +43,9 @@ dependencies {
         exclude group: 'com.fasterxml.jackson'
     }
 
-    // Because gradle uses groovy 3, we must use groovy 3 compatible versions for the grails-gradle-bom
-    api platform("org.codehaus.groovy:groovy-bom:${GroovySystem.version}")
+    // Use Gradle's embedded Groovy version for the grails-gradle-bom
+    // Groovy 4+ uses org.apache.groovy coordinates
+    api platform("org.apache.groovy:groovy-bom:${GroovySystem.version}")

Review Comment:
   Confirmed still in place. `grails-gradle/bom/build.gradle` imports `gradleBomPlatformDependencies['gradle-groovy-bom']` and the version lives in `dependencies.gradle` as `gradle-groovy.version: 4.0.31`. Resolving.



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -40,3 +40,29 @@ apply {
     from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Both compileJava and compileGroovy run the Micronaut annotation processor, each generating

Review Comment:
   The `compileJava.enabled = false` workaround you commented on was actually wrong and I had to undo it in `237527b` - the plugin does have Java code (`PluginJavaMicronautBean`) that `grails-test-examples/issue-11767/AppController.groovy` imports, so disabling `compileJava` broke the downstream `compileGroovy`. The current fix is a dedicated `mergeMicronautConfigMetadata` task that merges the two non-overlapping metadata files (one from `micronaut-inject-java`, one from `micronaut-inject-groovy`) into a single `META-INF/spring-configuration-metadata.json` that describes both beans. Full root-cause explanation is in the file comment block. Resolving.



##########
gradle.properties:
##########
@@ -54,15 +54,15 @@ gradleChecksumPluginVersion=1.4.0
 gradleCycloneDxPluginVersion=2.4.1

Review Comment:
   Confirmed still in place. `gradle.properties` now has `gradleCycloneDxPluginVersion=3.0.0` and `SbomPlugin` uses the new `CyclonedxDirectTask` API. Resolving.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   Confirmed still in place - `isReproducibleBuild` is a `Provider<Boolean>` evaluated lazily at execution time (line 218). Your follow-up clarification that it's a perf optimisation is noted. Resolving.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')

Review Comment:
   Confirmed still in place - `buildDate` is a `Provider<ZonedDateTime>` evaluated lazily at execution time (line 219). Resolving.



##########
build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/ExtractDependenciesTask.groovy:
##########
@@ -83,17 +86,26 @@ abstract class ExtractDependenciesTask extends DefaultTask {
     @Input
     abstract MapProperty<String, String> getProjectCoordinateProperties()
 
+    // Captured at configuration time to avoid deprecated Task.project access at execution time.
+    // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+    @Internal
+    DependencyHandler dependencyHandler
+
+    @Internal
+    ConfigurationContainer configurationContainer
+
     void setConfiguration(NamedDomainObjectProvider<Configuration> config) {
         dependencyArtifacts.from(config)
         configurationName.set(config.name)
     }
 
-    ExtractDependenciesTask() {
-        doFirst {
-            if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   Addressed differently based on your adjacent comment about `grails-bom/build.gradle` line 112 (#3094057606): the `java-platform` plugin check is only useful for external consumers of the task, and we do not ship this task externally, so I removed the check entirely rather than trying to persist a `PluginManager` reference. That sidesteps the `doFirst` / doAction dance altogether and matches your guidance for the adjacent thread. The `DependencyHandler` and `ConfigurationContainer` continue to be captured at configuration time via `captureProjectServices(...)`. Resolving.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3137474490


##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/PublishPlugin.groovy:
##########
@@ -92,9 +92,14 @@ class PublishPlugin implements Plugin<Project> {
             task.group = 'publishing'
             task.outputs.dir(artifactsDir)
             task.dependsOn(project.tasks.withType(Jar))
+
+            // Capture publishing extension at configuration time to avoid Task.project access at execution time
+            // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+            def publishingExtension = project.extensions.getByType(PublishingExtension)
+
             task.doLast {
                 Map<String, String> artifacts = [:]
-                project.extensions.getByType(PublishingExtension).publications.withType(MavenPublication).each { MavenPublication publication ->
+                publishingExtension.publications.withType(MavenPublication).each { MavenPublication publication ->

Review Comment:
   Resolved upstream in the companion PR (apache/grails-gradle-publish#25) - that PR tracks the Gradle 9.4.1 / Java 21 migration of the publish plugin. The snapshot is now published as `1.0.0-SNAPSHOT`, and this PR has been bumped to consume it (`dependencies.gradle` and `grails-forge/gradle.properties` both now pin `1.0.0-SNAPSHOT`). Added the Apache snapshots repo to root / `grails-gradle` / `grails-gradle/buildSrc` `pluginManagement` blocks so the composite build classpath can resolve the snapshot before `org.apache.grails.buildsrc.repo` itself is loaded. Resolving.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -145,13 +145,11 @@ class SbomPlugin implements Plugin<Project> {
     }
 
     private static void configureSbomTask(Project project, Provider<RegularFile> sbomOutputLocation) {
-        project.tasks.withType(CycloneDxTask).configureEach { CycloneDxTask task ->
+        project.tasks.withType(CyclonedxDirectTask).configureEach { CyclonedxDirectTask task ->

Review Comment:
   Yes - verified pre- and post-migration SBOM output earlier in the PR and it was identical apart from the expected timestamp/UUID differences (recorded in the PR description under Testing -> Plugin Output Verification for `cyclonedxBom` -> `cyclonedxDirectBom`). The `doLast` rewrite block still runs, rewriting the timestamp via the `Provider<Boolean>` / `Provider<ZonedDateTime>` pair, normalising `dependsOn` ordering, and recomputing the `serialNumber`. Resolving.



##########
gradle.properties:
##########
@@ -61,8 +61,8 @@ ersatzVersion=4.0.1
 grailsSpringSecurityVersion=7.0.2-SNAPSHOT
 jbossTransactionApiVersion=2.0.0.Final
 # Note: we do not import the micronaut bom in our tests to avoid spring version mismatches
-micronautHttpClientVersion=4.9.9
-micronautSerdeJacksonVersion=2.11.0
+micronautHttpClientVersion=4.10.18

Review Comment:
   Fixed in the latest commit. `grails-test-examples/micronaut/build.gradle` now imports `io.micronaut.platform:micronaut-platform` alongside the grails-bom and references `io.micronaut:micronaut-http-client`, `io.micronaut:micronaut-retry`, and `io.micronaut.serde:micronaut-serde-jackson` without explicit versions. The `micronautHttpClientVersion` and `micronautSerdeJacksonVersion` properties have been removed from the root `gradle.properties`. Resolving.



##########
grails-bom/build.gradle:
##########
@@ -107,6 +107,11 @@ configurations.register('bomDependencies').configure {
 }
 
 tasks.register('extractConstraints', ExtractDependenciesTask).configure { ExtractDependenciesTask it ->
+    // Capture project services at configuration time so the task avoids the deprecated Task.project at execution time
+    it.captureProjectServices(project.dependencies, project.configurations)
+    if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   Fixed in the latest commit. Dropped the `java-platform` plugin guard in `grails-bom/build.gradle` since the `extractConstraints` task is only consumed internally. Resolving.



##########
grails-doc/build.gradle:
##########
@@ -306,12 +306,13 @@ docsTask.configure { Sync it ->
 }
 
 tasks.register('dist', Zip).configure { Zip it ->
-    it.dependsOn(docsTask)
+    it.dependsOn(docsTask, tasks.named('groovydoc'))

Review Comment:
   Good catch - `grails-doc` has no real source to document (the `groovy` plugin is only applied to resolve BOM versions for the asciidoc templates, and `tasks.withType(Jar).configureEach { enabled = false }` already disables jar output). The default `groovydoc` task was writing an empty directory under `build/docs/groovydoc` which Gradle 9 was then flagging as an implicit input to `dist`. Fixed in the latest commit by disabling the default `groovydoc` task instead of depending on it from `dist` - the user-facing groovydoc is produced by `aggregateGroovydoc`, which is already wired into `docs`. Resolving.



##########
grails-doc/src/en/ref/Configuration/Application Properties.adoc:
##########
@@ -0,0 +1,866 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+////
+
+== Application Properties
+
+A comprehensive reference of all configuration properties specific to Grails and its bundled modules. These properties are set in `grails-app/conf/application.yml` (or `application.groovy`).

Review Comment:
   Agreed - that 866-line reference is unrelated to the Gradle 9 / Micronaut 4 upgrade. Removed from this PR in the latest commit; will submit it separately. Resolving.



##########
grails-forge/gradle.properties:
##########
@@ -23,27 +23,28 @@
 title=Grails Application Forge
 projectDesc=Generates Grails applications
 
-# for forge build process which is a micronaut 3.x.x app with picocli
+# for forge build process which is a micronaut 4.x.x app with picocli
 grailsPublishGradleVersion=0.0.2
 antVersion=1.10.15
 antlr4Version=4.8-1!!
-asciidoctorGradleJvmVersion=4.0.4
+asciidoctorGradleJvmVersion=4.0.5
 cglibVersion=3.3.0
+byteBuddyVersion=1.15.11
 commonsCompressVersion=1.27.1
 gradleSdkvendorPluginVersion=3.0.0
-groovyVersion=3.0.25
+groovyVersion=4.0.30

Review Comment:
   Fixed in the latest commit. `grails-forge/gradle.properties` is now `groovyVersion=4.0.31`. Resolving.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #15365:
URL: https://github.com/apache/grails-core/pull/15365


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4320039393

   ## Review feedback addressed (commits ccafe2bd86 .. fe527d1419)
   
   Pushed 8 atomic commits resolving every line comment from the latest review. Net effect vs prior PR head: **+153 / -241 across 20 files**. All commits are independently revertable.
   
   ### Commit ledger
   
   | Commit | Concern |
   |---|---|
   | `0196bd2dd0` (matrei, via merge) | #15597 `build: bootstrap Gradle plugin repositories` - shared `gradle/plugin-repositories.gradle` script (preserves authorship) |
   | `fe527d1419` | Merge of #15597 + drop the inline `pluginManagement.repositories` blocks I had added across 6 settings files. Also adopts matrei's refactor for `build-logic/settings.gradle` (deletes its 33-line inline block in favor of the shared script). All 7 settings files now route through the same `configurePluginRepositories(delegate)` |
   | `5d21fc3a39` | Drop 4 redundant explanatory comments flagged by @jdaugherty (`gradle.properties`, `grails-bom/build.gradle`, `GrailsGradlePlugin.groovy`, `GrailsProfileGradlePlugin.groovy`) |
   | `dae431d4a1` | Drop forge `jakartaInjectVersion` override - micronaut-platform 4.10.10 BOM manages it transitively (verified resolves to 2.0.1) |
   | `014355310b` | Drop forge `groovyVersion` override and the `eachDependency { useVersion(groovyVersion) }` resolutionStrategy block - BOM-managed (resolves to 4.0.28, the version Micronaut 4.10.10 was built against). spock-core override preserved |
   | `cc2f85fe07` | `gradle-groovy.version` derived from `GroovySystem.version` instead of hard-coded `'4.0.31'`. Published BOM now contains `<gradle-groovy.version>4.0.29</gradle-groovy.version>` (Gradle 9.4.1's bundled Groovy) |
   | `d9a218175a` | Make issue-11767 `mergeMicronautConfigMetadata` properly cacheable - writes to separate `build/merged-spring-configuration-metadata/` dir, declares lazy inputs/outputs, jar uses `eachFile` filter. Second invocation now reports `UP-TO-DATE` |
   | `ccafe2bd86` | Roll selenium 4.41.0 → 4.37.0 (Spring Boot 4.0.5 BOM aligned) and drop the OpenTelemetry 1.59.0 override + 24-module constraint list. The override existed only to bridge the selenium-4.41 ↔ spring-boot-4.0.5 opentelemetry conflict; aligning with Spring Boot's choice eliminates it. Net diff in `dependencies.gradle`: -40 lines |
   
   ### Verification matrix
   
   | Check | Result |
   |---|---|
   | `./gradlew help` (root + grails-gradle + grails-forge composites, JDK 21, Gradle 9.4.1) | PASS |
   | `./gradlew validateDependencyVersions` (whole project, 157 tasks) | PASS |
   | `./gradlew :grails-bom:generatePomFileForMavenPublication` | PASS |
   | `./gradlew :grails-gradle-bom:generatePomFileForMavenPublication` | PASS (publishes `gradle-groovy.version=4.0.29`) |
   | `./gradlew :grails-forge-{api,cli,core,test-core}:compileTestGroovy` | PASS (groovy 4.0.28 from BOM) |
   | `./gradlew :grails-forge-api:dependencies --configuration compileClasspath` | jakarta-inject -> 2.0.1 via BOM |
   | `./gradlew :grails-test-examples-plugins-issue-11767:clean :...:jar` | PASS - jar contains 1 merged `META-INF/spring-configuration-metadata.json` with both Java + Groovy beans |
   | Second invocation of `:grails-test-examples-plugins-issue-11767:jar` | All UP-TO-DATE (caching works) |
   | `./gradlew :grails-test-examples-issue-11767:compileGroovy` (consumer) | PASS |
   | `./gradlew :grails-forge-analytics-postgres:assemble :...:dockerfile :...:dockerfileNative` | PASS (no shadow plugin needed - CI uses `dockerBuildNative`) |
   | `./gradlew :grails-test-examples-{geb,geb-context-path,geb-gebconfig}:compileTestGroovy` | PASS (Selenium 4.37) |
   
   ### Resolves all open review threads
   
   - 6× "use #15597 instead" on settings files → `fe527d1419`
   - `dependencies.gradle:32` "GroovySystem version instead of hard coding" → `cc2f85fe07`
   - `dependencies.gradle:86` opentelemetry rationale → `ccafe2bd86` (deleted, no longer needed)
   - `dependencies.gradle:95` selenium pinning vs geb issues → `ccafe2bd86` (rolled back to Spring Boot's 4.37)
   - `gradle.properties:53` "Remove the comment" → `5d21fc3a39`
   - `grails-bom/build.gradle:110` "this is bridge, remove it" → `5d21fc3a39`
   - `grails-forge-analytics-postgres/build.gradle:21` shadow plugin removal → verified safe (dockerBuildNative is the deploy path)
   - `grails-forge-api/build.gradle:52` jakarta-inject mismatch concern → `dae431d4a1`
   - `test-core/build.gradle:62` followup on groovyVersion → `014355310b`
   - `GrailsGradlePlugin.groovy:981` "remove the comment" → `5d21fc3a39`
   - `GrailsProfileGradlePlugin.groovy:90` "remove the comment" → `5d21fc3a39`
   - `issue-11767/build.gradle:77` cacheable merge → `d9a218175a`
   
   Ready for re-review @jdaugherty @matrei.
   
   Assisted-by: claude-code:claude-opus-4-7
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3824315091

   @jamesfredley did Gradle 9 not remove the testClassDir as they said they would?  It was my understanding the integration plugin + TCK had to be rewritten similar to the grails-publish project to work.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3061884293


##########
grails-gradle/bom/build.gradle:
##########
@@ -43,8 +43,9 @@ dependencies {
         exclude group: 'com.fasterxml.jackson'
     }
 
-    // Because gradle uses groovy 3, we must use groovy 3 compatible versions for the grails-gradle-bom
-    api platform("org.codehaus.groovy:groovy-bom:${GroovySystem.version}")
+    // Use Gradle's embedded Groovy version for the grails-gradle-bom
+    // Groovy 4+ uses org.apache.groovy coordinates
+    api platform("org.apache.groovy:groovy-bom:${GroovySystem.version}")

Review Comment:
   We are setting it to the gradle groovy version in some places and then the grails-gradle-bom in others. I'd suggest we extract the groovy version into the gradle bom map in dependencies.gradle  then reference that variable here so we're consistent on the same version.



##########
.sdkmanrc:
##########
@@ -2,5 +2,5 @@
 java=17.0.18-librca
 # Keep gradle version synced with gradle.properties (gradleToolingApiVersion), all gradle-wrapper.properties files,

Review Comment:
   We should update this comment, you just have to update the bootstrap project and it will copy these to the right locations, only the api update is needed.



##########
gradle.properties:
##########
@@ -54,15 +54,15 @@ gradleChecksumPluginVersion=1.4.0
 gradleCycloneDxPluginVersion=2.4.1

Review Comment:
   2.4.1 does not officially support gradle 9.x.  3.0.0 is a requirement to upgrade to Gradle 9.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   This should be a provider that's still looked up at execution time. 



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy:
##########
@@ -87,48 +87,30 @@ class GrailsProfileGradlePlugin implements Plugin<Project> {
         project.configurations.named('runtimeElements')
                 .configure { it.extendsFrom(runtimeOnlyConfiguration.get()) }
 
-        TaskProvider<Task> processProfileResourcesTask = project.tasks.register('processProfileResources')
-        processProfileResourcesTask.configure { Task task ->
+        // Use Sync task type instead of project.sync in doLast to avoid Task.project access at execution time
+        // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+        TaskProvider<Sync> processProfileResourcesTask = project.tasks.register('processProfileResources', Sync)
+        processProfileResourcesTask.configure { Sync task ->
             task.group = 'build'

Review Comment:
   Why were the inputs removed? 



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -40,3 +40,29 @@ apply {
     from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Both compileJava and compileGroovy run the Micronaut annotation processor, each generating

Review Comment:
   Isn't compileJava supposed to be disabled?  We don't even have java code in this test.  This seems like something else is wrong.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')

Review Comment:
   This should be a provider, that's still looked up at execution time.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3142224148


##########
buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {
+        mavenCentral()
+        gradlePluginPortal()
+        // Needed to resolve grails-publish snapshots that the build-logic composite

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
grails-forge/buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
grails-forge/settings.gradle:
##########
@@ -19,6 +19,23 @@
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
grails-gradle/buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
grails-gradle/settings.gradle:
##########
@@ -19,14 +19,31 @@
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
settings.gradle:
##########
@@ -20,6 +20,23 @@ import org.apache.tools.ant.DirectoryScanner
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   Done in fe527d1419. Merged matrei's gradle-plugin-bootstrap branch from #15597 (preserving authorship through the merge commit) and removed the inline pluginManagement.repositories { ... } block I had here. All seven settings files (root, build-logic, buildSrc, grails-forge, grails-forge/buildSrc, grails-gradle, grails-gradle/buildSrc) now route plugin repos through the shared gradle/plugin-repositories.gradle script.



##########
dependencies.gradle:
##########
@@ -22,15 +22,16 @@
 // These files are split to facilitate separation of build vs application dependencies. These are the application dependencies.
 ext {
     gradleBomDependencyVersions = [
-            'ant.version'                   : '1.10.15',
+            'ant.version'                   : '1.10.17',
             'asciidoctor-gradle-jvm.version': '4.0.5',
             'asciidoctorj.version'          : '3.0.0',
             'asset-pipeline-gradle.version' : '5.1.0-M4',
-            'byte-buddy.version'            : '1.17.8',
-            'commons-text.version'          : '1.14.0',
+            'byte-buddy.version'            : '1.18.8',
+            'commons-text.version'          : '1.15.0',
             'directory-watcher.version'     : '0.19.1',
-            'gradle-spock.version'          : '2.3-groovy-3.0',
-            'grails-publish-plugin.version' : '0.0.4',
+            'gradle-groovy.version'         : '4.0.31',

Review Comment:
   Done in cc2f85fe07. `gradle-groovy.version` is now `GroovySystem.version`. Verified the published `grails-gradle-bom` POM contains `<gradle-groovy.version>4.0.29</gradle-groovy.version>` (Gradle 9.4.1's bundled Groovy). Future wrapper bumps flow through automatically.



##########
dependencies.gradle:
##########
@@ -73,20 +75,26 @@ ext {
             'asset-pipeline-bom.version'  : '5.1.0-M4',
             'bootstrap-icons.version'     : '1.13.1',
             'bootstrap.version'           : '5.3.8',
-            'commons-codec.version'       : '1.19.0',
+            'commons-codec.version'       : '1.21.0',
             'commons-lang3.version'       : '3.20.0',
             'geb-spock.version'           : '8.0.1',
             'groovy.version'              : '4.0.31',
 
             'jquery.version'              : '3.7.1',
             'liquibase-hibernate5.version': '4.27.0',
             'mongodb.version'             : '5.6.4',
+            // Selenium 4.41+ requires OpenTelemetry 1.59+, which is newer than the
+            // 1.55.x that Spring Boot 4.0.5 manages. Pin the version on the individual
+            // OpenTelemetry modules (see the constraints block in grails-bom/build.gradle)
+            // so the explicit constraint overrides whatever Spring Boot's imported BOM
+            // declares, regardless of platform import ordering.
+            'opentelemetry.version'       : '1.59.0',
             'rxjava.version'              : '1.3.8',
             'rxjava2.version'             : '2.2.21',
             'rxjava3.version'             : '3.1.12',
-            'selenium.version'            : '4.38.0',
+            'selenium.version'            : '4.41.0',

Review Comment:
   Investigated; resolved in ccafe2bd86.
   
   Spring Boot 4.0.5's BOM declares selenium `4.37.0` ([spring-boot-dependencies 4.0.5](https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/4.0.5/dependencies)). I rolled selenium back from 4.41.0 to 4.37.0 to track Spring Boot's choice. The OpenTelemetry 1.59.0 override and the 24-module constraint list that the 4.41 bump previously required are no longer needed - Spring Boot's managed 1.55.x line is sufficient for selenium 4.37.
   
   Verified:
   
   - `gradle validateDependencyVersions` passes across all 157 reporting tasks (no resolved-vs-BOM mismatches).
   - `gradle :grails-test-examples-{geb,geb-context-path,geb-gebconfig}:compileTestGroovy` succeeds.
   - The geb test apps now resolve `org.seleniumhq.selenium:selenium-bom:4.37.0` with no transitive opentelemetry conflict.
   
   Net diff: `dependencies.gradle` shrinks by 40 lines.



##########
dependencies.gradle:
##########
@@ -73,20 +75,26 @@ ext {
             'asset-pipeline-bom.version'  : '5.1.0-M4',
             'bootstrap-icons.version'     : '1.13.1',
             'bootstrap.version'           : '5.3.8',
-            'commons-codec.version'       : '1.19.0',
+            'commons-codec.version'       : '1.21.0',
             'commons-lang3.version'       : '3.20.0',
             'geb-spock.version'           : '8.0.1',
             'groovy.version'              : '4.0.31',
 
             'jquery.version'              : '3.7.1',
             'liquibase-hibernate5.version': '4.27.0',
             'mongodb.version'             : '5.6.4',
+            // Selenium 4.41+ requires OpenTelemetry 1.59+, which is newer than the

Review Comment:
   The opentelemetry pin existed only because selenium 4.41+ pulled in `opentelemetry-*` modules newer than the 1.55.x line that Spring Boot 4.0.5 manages, which the dependency-version validator flagged. Not related to forge / micronaut.
   
   Now that ccafe2bd86 rolls selenium back to 4.37.0 (Spring Boot's managed version), there is no more transitive conflict and the entire opentelemetry block - the `opentelemetry.version` constant plus all 24 `opentelemetry-*` constraints - is gone.



##########
gradle.properties:
##########
@@ -50,8 +50,8 @@ yakworksHibernateGroovyProxyVersion=1.1
 # Build dependency versions not managed by BOMs
 apacheRatVersion=0.8.1
 gradleChecksumPluginVersion=1.4.0
-# note: the cyclonedx 3 requires Gradle 9
-gradleCycloneDxPluginVersion=2.4.1
+# CycloneDX Gradle plugin version

Review Comment:
   Done in 5d21fc3a39.



##########
grails-bom/build.gradle:
##########
@@ -107,6 +107,8 @@ configurations.register('bomDependencies').configure {
 }
 
 tasks.register('extractConstraints', ExtractDependenciesTask).configure { ExtractDependenciesTask it ->
+    // Capture project services at configuration time so the task avoids the deprecated Task.project at execution time

Review Comment:
   Done in 5d21fc3a39.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4320073079

   ## CI fixes (commits 735ce324df, 0314d5fd96)
   
   Pushed two follow-up commits resolving the CI failures introduced by the previous batch.
   
   ### Failures and fixes
   
   | Failing job(s) | Root cause | Fix | Commit |
   |---|---|---|---|
   | `Validate Dependency Versions` | `GroovySystem.version` returns Gradle's *bundled* Groovy (4.0.29 for Gradle 9.4.1), but grails-gradle plugin code transitively resolves 4.0.31 via grails-core. The validator flagged every `org.apache.groovy:*` artifact as `resolved 4.0.31, expected 4.0.29` and failed. | Revert `gradle-groovy.version` to hard-coded `'4.0.31'`. Added an inline comment (no specific version numbers - those drift) explaining why `GroovySystem.version` is not viable here. | `735ce324df` |
   | `Build Grails Forge (Java 21, indy=false)`, `(Java 21, indy=true)`, `(Java 25, indy=false)` | After 014355310b dropped `:$groovyVersion` from the `documentation` entries in `grails-forge/gradle/doc-config.gradle`, the unversioned `org.apache.groovy:groovy-*` artifacts had no version source. The `documentation` configuration is registered by the buildsrc.groovydoc plugin and is independent of `compileClasspath` / `testRuntimeClasspath`, so the micronaut-platform BOM applied in each forge module's main `dependencies { }` block does not reach it. groovydoc failed with `Could not find org.apache.groovy:groovy-templates:.` | Apply `platform("io.micronaut.platform:micronaut-platform:$micronautVersion")` to the `documentation` configuration in `doc-config.gradle` so unversioned coordinates resolve through `groovy-bom`. Same BOM-driven approach we use elsewhere in forge. | `0314d5fd96` |
   | `Build Grails-Core (windows-latest, 25)` | Transient Maven Central 403 while resolving `org.cyclonedx:cyclonedx-core-java:11.0.0`: `Received status code 403 from server: Forbidden` from both `repo.maven.apache.org/maven2` and `plugins.gradle.org/m2`. Not a code issue. | None - should clear on retry. The same job passes on Linux runners and on JDK 21 Windows runs. | n/a |
   
   ### Verification
   
   | Check | Result |
   |---|---|
   | `./gradlew :grails-gradle-plugins:validateDependencyVersions :grails-gradle-tasks:validateDependencyVersions` | PASS |
   | `./gradlew validateDependencyVersions` (whole project, 157 tasks) | PASS |
   | `./gradlew :grails-forge-cli:groovydoc :grails-forge-api:groovydoc :grails-forge-core:groovydoc` | PASS |
   
   ### Note on `GroovySystem.version` (re #15365 (comment 3141965549))
   
   @jdaugherty - your original suggestion to derive `gradle-groovy.version` from `GroovySystem.version` was reasonable in principle but breaks `validateDependencyVersions` whenever Gradle's bundled Groovy lags grails-core's chosen Groovy. They're independently versioned and currently differ by one patch. I went back to the literal so the BOM matches what we actually publish/resolve. Discussion in https://github.com/apache/grails-core/pull/15365#discussion_r3141965549 - happy to revisit if you'd prefer a different formulation.
   
   Assisted-by: claude-code:claude-opus-4-7
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4299400807

   Companion PR for the Gradle 9.4.1 upgrade in `grails-gradle-publish`: apache/grails-gradle-publish#25


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3825637724

   grails-bom and /ref/Versions/Grails%20BOM.html have the correct dependencies and versions. 


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3094018532


##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/PublishPlugin.groovy:
##########
@@ -92,9 +92,14 @@ class PublishPlugin implements Plugin<Project> {
             task.group = 'publishing'
             task.outputs.dir(artifactsDir)
             task.dependsOn(project.tasks.withType(Jar))
+
+            // Capture publishing extension at configuration time to avoid Task.project access at execution time
+            // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+            def publishingExtension = project.extensions.getByType(PublishingExtension)
+
             task.doLast {
                 Map<String, String> artifacts = [:]
-                project.extensions.getByType(PublishingExtension).publications.withType(MavenPublication).each { MavenPublication publication ->
+                publishingExtension.publications.withType(MavenPublication).each { MavenPublication publication ->

Review Comment:
   We use the publish plugin and it definitely needs updated to support Gradle 9, but I don't see any PR's on https://github.com/apache/grails-gradle-publish 
   
   Shouldn't we update this plugin prior to merging this PR since it's also incompatible with 9?



##########
gradle.properties:
##########
@@ -61,8 +61,8 @@ ersatzVersion=4.0.1
 grailsSpringSecurityVersion=7.0.2-SNAPSHOT
 jbossTransactionApiVersion=2.0.0.Final
 # Note: we do not import the micronaut bom in our tests to avoid spring version mismatches
-micronautHttpClientVersion=4.9.9
-micronautSerdeJacksonVersion=2.11.0
+micronautHttpClientVersion=4.10.18

Review Comment:
   Can we just update the test example that uses these 2 micronaut values to use the micronaut bom & not refer to specific versions?  Mattias already removed all other usages other than the test app for micronaut.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -145,13 +145,11 @@ class SbomPlugin implements Plugin<Project> {
     }
 
     private static void configureSbomTask(Project project, Provider<RegularFile> sbomOutputLocation) {
-        project.tasks.withType(CycloneDxTask).configureEach { CycloneDxTask task ->
+        project.tasks.withType(CyclonedxDirectTask).configureEach { CyclonedxDirectTask task ->

Review Comment:
   Have you compared the new vs old task output and confirmed our doLast hack still works? 



##########
build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/ExtractDependenciesTask.groovy:
##########
@@ -83,17 +86,26 @@ abstract class ExtractDependenciesTask extends DefaultTask {
     @Input
     abstract MapProperty<String, String> getProjectCoordinateProperties()
 
+    // Captured at configuration time to avoid deprecated Task.project access at execution time.
+    // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+    @Internal
+    DependencyHandler dependencyHandler
+
+    @Internal
+    ConfigurationContainer configurationContainer
+
     void setConfiguration(NamedDomainObjectProvider<Configuration> config) {
         dependencyArtifacts.from(config)
         configurationName.set(config.name)
     }
 
-    ExtractDependenciesTask() {
-        doFirst {
-            if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   I agree this is the right short term solution, but this task will ship publicly again.  I was speaking to Vampire in Gradle chat, eventually I'll probably add this is as it's own gradle plugin where the doFirst { } throws an error.  Then the plugin removes the action so it passes.  Something like this (from Vampire's chat):
   
           val foo = Action<Task> {
               error("FOO")
           }
           tasks.help {
               doFirst("foo", foo)
           }
           pluginManager.withPlugin("java-platform") {
               tasks.help {
                   actions.remove(foo)
               }
           }
   
   
   But before doing any of this, did you see if you can store a reference to the pluginManager and still have this validation? Is that allowed? 



##########
grails-doc/src/en/ref/Configuration/Application Properties.adoc:
##########
@@ -0,0 +1,866 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+////
+
+== Application Properties
+
+A comprehensive reference of all configuration properties specific to Grails and its bundled modules. These properties are set in `grails-app/conf/application.yml` (or `application.groovy`).

Review Comment:
   I dont' think this change should be made as part of micronaut PR



##########
grails-forge/gradle.properties:
##########
@@ -23,27 +23,28 @@
 title=Grails Application Forge
 projectDesc=Generates Grails applications
 
-# for forge build process which is a micronaut 3.x.x app with picocli
+# for forge build process which is a micronaut 4.x.x app with picocli
 grailsPublishGradleVersion=0.0.2
 antVersion=1.10.15
 antlr4Version=4.8-1!!
-asciidoctorGradleJvmVersion=4.0.4
+asciidoctorGradleJvmVersion=4.0.5
 cglibVersion=3.3.0
+byteBuddyVersion=1.15.11
 commonsCompressVersion=1.27.1
 gradleSdkvendorPluginVersion=3.0.0
-groovyVersion=3.0.25
+groovyVersion=4.0.30

Review Comment:
   Maybe bump to 4.0.31 to match grails-core? 



##########
grails-bom/build.gradle:
##########
@@ -107,6 +107,11 @@ configurations.register('bomDependencies').configure {
 }
 
 tasks.register('extractConstraints', ExtractDependenciesTask).configure { ExtractDependenciesTask it ->
+    // Capture project services at configuration time so the task avoids the deprecated Task.project at execution time
+    it.captureProjectServices(project.dependencies, project.configurations)
+    if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   The only reason this existed before was in case external parties used our task.  Let's remove it from here.



##########
grails-forge/grails-forge-api/build.gradle:
##########
@@ -57,22 +58,23 @@ dependencies {
     testImplementation 'io.micronaut:micronaut-http-client'
     testImplementation 'io.micronaut:micronaut-http-server-netty'
     testImplementation 'io.micronaut.test:micronaut-test-spock'
+    testRuntimeOnly 'io.micronaut:micronaut-jackson-databind'
 
     testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"

Review Comment:
   We have the micronaut bom, why keep specifying values individually?  Can't we adopt their bom and drop custom versions? 



##########
grails-doc/build.gradle:
##########
@@ -306,12 +306,13 @@ docsTask.configure { Sync it ->
 }
 
 tasks.register('dist', Zip).configure { Zip it ->
-    it.dependsOn(docsTask)
+    it.dependsOn(docsTask, tasks.named('groovydoc'))

Review Comment:
   Why is groovydoc a requirement of dist?  Isn't it part of the build already?



##########
grails-forge/grails-forge-web-netty/build.gradle:
##########
@@ -32,6 +31,7 @@ dependencies {
     implementation 'io.micronaut.gcp:micronaut-gcp-http-client'
 
     runtimeOnly 'ch.qos.logback:logback-classic'
+    runtimeOnly 'io.micronaut:micronaut-jackson-databind'

Review Comment:
   I thought we used serde instead of jackson? 



##########
build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/ExtractDependenciesTask.groovy:
##########
@@ -83,17 +86,26 @@ abstract class ExtractDependenciesTask extends DefaultTask {
     @Input
     abstract MapProperty<String, String> getProjectCoordinateProperties()
 
+    // Captured at configuration time to avoid deprecated Task.project access at execution time.
+    // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+    @Internal
+    DependencyHandler dependencyHandler
+
+    @Internal
+    ConfigurationContainer configurationContainer
+
     void setConfiguration(NamedDomainObjectProvider<Configuration> config) {
         dependencyArtifacts.from(config)
         configurationName.set(config.name)
     }
 
-    ExtractDependenciesTask() {
-        doFirst {
-            if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   AI seems to agree:  
   
           public abstract class MyTask extends DefaultTask {
               @Input
               public abstract Property<Boolean> getRequiredPluginApplied();
   
               @TaskAction
               public void run() {
                   if (!getRequiredPluginApplied().get()) {
                       throw new GradleException(
                           "Task '" + getPath() + "' requires plugin 'com.example.required' to be applied.");
                   }
   
                   // real task work
               }
           }
   
           public class MyPlugin implements Plugin<Project> {
               @Override
               public void apply(Project project) {
                   TaskProvider<MyTask> myTask = project.getTasks().register("myTask", MyTask.class, task -> {
                       task.getRequiredPluginApplied().convention(false);
                   });
   
                   project.getPluginManager().withPlugin("com.example.required", applied ->
                       myTask.configure(task -> task.getRequiredPluginApplied().set(true))
                   );
               }
           }



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy:
##########
@@ -248,19 +249,17 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
         project.afterEvaluate() {
             ProcessResources processResources = (ProcessResources) project.tasks.getByName('processResources')
 
-            def processResourcesDependencies = []
-
-            processResourcesDependencies << project.task(type: Copy, 'copyCommands') {
+            TaskProvider<Copy> copyCommands = project.tasks.register('copyCommands', Copy) {
                 from("${project.projectDir}/src/main/scripts")
                 into("${processResources.destinationDir}/META-INF/commands")
             }
 
-            processResourcesDependencies << project.task(type: Copy, 'copyTemplates') {
+            TaskProvider<Copy> copyTemplates = project.tasks.register('copyTemplates', Copy) {
                 from("${project.projectDir}/src/main/templates")
                 into("${processResources.destinationDir}/META-INF/templates")
             }
             processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
-            processResources.dependsOn(*processResourcesDependencies)
+            processResources.dependsOn(copyCommands, copyTemplates)

Review Comment:
   Was this an intentional change or an AI changing the style? 



##########
grails-forge/test-core/build.gradle:
##########
@@ -59,15 +59,15 @@ dependencies {
         testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"
     }
 
-    testImplementation "org.codehaus.groovy:groovy:$groovyVersion"
+    testImplementation "org.apache.groovy:groovy:$groovyVersion"

Review Comment:
   Can't we use the micronaut bom? 



##########
grails-forge/grails-forge-core/build.gradle:
##########
@@ -41,13 +41,15 @@ sourceSets {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Can't we adopt the micronaut bom to set the versions below? 



##########
grails-forge/grails-forge-cli/build.gradle:
##########
@@ -68,10 +68,10 @@ ext {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
+    implementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Can't we adopt the micronaut bom to set the versions below? 



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4255476938

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 38620a90a3d29f71110da0b811c3d5a79dd3072c
   ▶️ Tests:  110 executed
   ⚪️ Checks: 33/33 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3089275588


##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy:
##########
@@ -87,48 +87,30 @@ class GrailsProfileGradlePlugin implements Plugin<Project> {
         project.configurations.named('runtimeElements')
                 .configure { it.extendsFrom(runtimeOnlyConfiguration.get()) }
 
-        TaskProvider<Task> processProfileResourcesTask = project.tasks.register('processProfileResources')
-        processProfileResourcesTask.configure { Task task ->
+        // Use Sync task type instead of project.sync in doLast to avoid Task.project access at execution time
+        // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+        TaskProvider<Sync> processProfileResourcesTask = project.tasks.register('processProfileResources', Sync)
+        processProfileResourcesTask.configure { Sync task ->
             task.group = 'build'

Review Comment:
   Fixed. Restored the 4 \inputs.dir(...).optional().skipWhenEmpty()\ declarations. The Sync task type handles its own inputs/outputs via \rom()\, but the explicit input declarations preserve the skip-when-empty behavior that prevents unnecessary work when profile directories don't exist.



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -40,3 +40,29 @@ apply {
     from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Both compileJava and compileGroovy run the Micronaut annotation processor, each generating

Review Comment:
   Fixed. Replaced the JSON metadata merge hack with \compileJava.enabled = false\ since there's no Java source code in this test plugin.



##########
gradle.properties:
##########
@@ -54,15 +54,15 @@ gradleChecksumPluginVersion=1.4.0
 gradleCycloneDxPluginVersion=2.4.1

Review Comment:
   Fixed. Upgraded CycloneDX from 2.4.1 to 3.0.0. Rewrote SbomPlugin to use the new \CyclonedxDirectTask\ API with property-based configuration, and updated task name references from \cyclonedxBom\ to \cyclonedxDirectBom\.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   Fixed. Converted \isReproducibleBuild\ to a \Provider<Boolean>\ that is evaluated lazily at execution time via \project.provider { lookupProperty(project, 'isReproducibleBuild') as boolean }\.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')

Review Comment:
   Fixed. Converted \uildDate\ to a \Provider<ZonedDateTime>\ that is evaluated lazily at execution time via \project.provider { lookupProperty(project, 'buildDate') as ZonedDateTime }\.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4312911760

   ## Round of review feedback addressed
   
   **Telemetry override (your top-level comment):** swapped the `opentelemetry-bom` platform import for an explicit list of constraints on the individual `io.opentelemetry:opentelemetry-*` modules in `dependencies.gradle` / `grails-bom/build.gradle`. Explicit constraints win over any imported BOM's transitively-managed version, so this no longer relies on platform import ordering (same class of issue you hit on the hibernate PR).
   
   **`grails-publish` 0.0.4 -> 1.0.0-SNAPSHOT:** consume the new Gradle 9 / Java 21 build of the publish plugin. Added the apache snapshots repo to the root, `grails-gradle`, and `grails-gradle/buildSrc` `pluginManagement` blocks so the composite build classpath can resolve the snapshot before `org.apache.grails.buildsrc.repo` itself is loaded (chicken-and-egg with the existing `includeBuild`-only pluginManagement). Companion PR: apache/grails-gradle-publish#25.
   
   **Inline review threads (all 20 resolved):** see individual replies on each thread. Every prior unresolved item is now either confirmed already in place or fixed in the new commit:
   * `grails-forge` `micronaut-inject-groovy` and `jackson-databind` -> serde-jackson via the BOM (5 forge build files + `test-core` + `analytics-postgres`)
   * `grails-forge/gradle.properties` `groovyVersion` 4.0.30 -> 4.0.31
   * `grails-bom/build.gradle` java-platform plugin guard removed (per your guidance the task is internal-only)
   * `grails-doc/build.gradle` per-project `groovydoc` task disabled (no real source to document) instead of adding a `dist` dependency on it
   * `gradle.properties` `micronautHttpClientVersion` / `micronautSerdeJacksonVersion` removed; `grails-test-examples-micronaut` now uses the micronaut-platform BOM
   * `Application Properties.adoc` reverted out of this PR (will submit separately)
   
   **Latest 8.0.x merged in:** picked up the Jansi/JLine upgrade (#15367), forge GraalVM image fixes (#15579, #15580), pull request template, and 7.1.0 release. One conflict in `dependencies.gradle` resolved by keeping the gradle-9 versions (`gradle-spock 2.3-groovy-4.0`, `gradle-groovy 4.0.31`, `grails-publish 1.0.0-SNAPSHOT`) and 8.0.x's `jansi 2.4.2`.
   
   Locally verified `./gradlew :grails-bom:extractConstraints` and `./gradlew :grails-test-examples-scaffolding:validateDependencyVersions` both pass on Java 21+ after the merge.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4312911741

   Related #15597 


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3824350016

   * Have you tested the extractConstraints & bom plugins?  It's my understanding that cross project resolution doesn't work in Gradle 9.  Have you diffed the versions to see that it's working? 


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3142259348


##########
grails-forge/grails-forge-core/build.gradle:
##########
@@ -41,13 +41,15 @@ sourceSets {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
+    implementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
     annotationProcessor 'io.micronaut:micronaut-inject-java'
-    testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
+    testAnnotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
     testAnnotationProcessor 'io.micronaut:micronaut-inject-java'
 
-    api platform("io.micronaut:micronaut-bom:$micronautVersion") // TODO: Should this be api?
+    api platform("io.micronaut.platform:micronaut-platform:$micronautVersion") // TODO: Should this be api?
+    api "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"

Review Comment:
   Still a hardcoded version here



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4255953669

   ## Comprehensive Summary of All Changes
   
   Every item from @jdaugherty's review has been addressed across two commits (`38620a90` and `49d6418f`). Here's the full mapping:
   
   ---
   
   ### Inline Review Comments (9/9 resolved)
   
   | Comment | File | Resolution |
   |---|---|---|
   | Unused imports | ApplicationContextCommandTask.groovy | Already cleaned up in prior commit |
   | junit-platform-launcher version | test-config.gradle | Added explicit version `1.12.2` |
   | .sdkmanrc comment | .sdkmanrc | Updated to reference gradle-bootstrap project |
   | Groovy version consistency | bom/build.gradle + dependencies.gradle | Extracted to `gradleBomDependencyVersions` map |
   | Inputs removed from Sync task | GrailsProfileGradlePlugin.groovy | Restored 4 `inputs.dir().optional().skipWhenEmpty()` declarations |
   | compileJava should be disabled | issue-11767/build.gradle | Disabled compileJava, removed metadata merge hack |
   | CycloneDX 3.0.0 | gradle.properties + SbomPlugin.groovy | Full rewrite for `CyclonedxDirectTask` API |
   | isReproducibleBuild provider | SbomPlugin.groovy | Converted to `Provider<Boolean>` |
   | buildDate provider | SbomPlugin.groovy | Converted to `Provider<ZonedDateTime>` |
   
   ---
   
   ### Big Issue 1 - Gradle 9 Blockers in grails-gradle Plugins (all fixed)
   
   **Blockers (removed in Gradle 9):**
   - `GrailsExtension.groovy`: Replaced `ConfigureUtil.configure()` with Groovy closure delegation (`configureClosure.delegate/resolveStrategy/call()`)
   - `GrailsGradlePlugin.groovy`: `project.buildDir` was already migrated to `layout.buildDirectory` in the original PR
   - `IntegrationTestGradlePlugin.groovy`: No violations found (already compliant)
   
   **Config Cache / Project Isolation:**
   - `GrailsProfileGradlePlugin.groovy`: Already converted from `project.sync` in doLast to typed `Sync` task in original PR; restored explicit inputs
   - `GrailsGradlePlugin.groovy`: `buildProperties` migrated from `tasks.create` to `tasks.register`
   
   **Eager Task APIs:**
   - `GrailsGradlePlugin.groovy`: `project.tasks.create('buildProperties')` -> `tasks.register(...)`
   - `GrailsPluginGradlePlugin.groovy`: `project.task(type: Copy, 'copyCommands')` -> `tasks.register('copyCommands', Copy)`
   - `GrailsPluginGradlePlugin.groovy`: `project.task(type: Copy, 'copyTemplates')` -> `tasks.register('copyTemplates', Copy)`
   
   ---
   
   ### Big Issue 2 - Configuration Cache (fixed)
   
   Explicitly set `org.gradle.configuration-cache=false` in gradle.properties with reference to #15497.
   
   ---
   
   ### Big Issue 3 - ExtractDependenciesTask (fixed for current scope)
   
   - Removed `doFirst` plugin check - moved to configuration time in grails-bom/build.gradle
   - Replaced `project.configurations.named(...)` in `@TaskAction` with captured `ConfigurationContainer`
   - Replaced `project.dependencies.create(...)` and `project.configurations.detachedConfiguration(...)` with captured `DependencyHandler`/`ConfigurationContainer` via new `captureProjectServices()` method
   
   **Note:** The task still creates detached configurations at execution time, which is incompatible with configuration cache. Since configuration cache is explicitly disabled, this works correctly. A full redesign (BuildService or pre-resolve approach per the review) is deferred until configuration cache is re-enabled.
   
   ---
   
   ### CI Fix
   
   All CI jobs were failing on `unable to resolve class org.gradle.api.internal.ClosureBackedAction` - fixed by replacing with plain Groovy closure delegation.
   
   ---
   
   ### Dependency Bumps
   
   - byte-buddy 1.17.8 -> 1.18.8
   - commons-text 1.14.0 -> 1.15.0
   - ant 1.10.15 -> 1.10.17
   - commons-codec 1.19.0 -> 1.21.0
   - selenium-bom 4.38.0 -> 4.41.0
   - mockito-core 5.20.0 -> 5.23.0
   
   ---
   
   ### Remaining / Deferred
   
   1. **ExtractDependenciesTask full config cache redesign** - Not needed until `org.gradle.configuration-cache=true` is re-enabled. Will require BuildService-based or pre-resolve approach per the review.
   2. **Spock 2.4, Kotlin 2.3.x, Groovy 5.x** - Available but too risky for this PR. Should be separate PRs.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4255943270

   **CI Fix + Dependency Updates**
   
   All CI jobs were failing on a single compilation error: `org.gradle.api.internal.ClosureBackedAction` was removed in Gradle 9. Fixed by replacing with plain Groovy closure delegation (`configureClosure.delegate = plugins; configureClosure.resolveStrategy = Closure.DELEGATE_FIRST; configureClosure.call()`).
   
   Also bumped patch-level dependencies:
   - byte-buddy 1.17.8 -> 1.18.8
   - commons-text 1.14.0 -> 1.15.0
   - ant 1.10.15 -> 1.10.17
   - commons-codec 1.19.0 -> 1.21.0
   - selenium-bom 4.38.0 -> 4.41.0
   - mockito-core 5.20.0 -> 5.23.0
   
   Skipped (too risky for this PR):
   - Groovy 5.0.x (major version, Grails 8.0.x targets Groovy 4.0.x)
   - Spock 2.4-groovy-4.0 (testing framework upgrade should be a separate PR)
   - Kotlin 2.3.x (major version, Micronaut compatibility concerns)


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3141966343


##########
dependencies.gradle:
##########
@@ -73,20 +75,26 @@ ext {
             'asset-pipeline-bom.version'  : '5.1.0-M4',
             'bootstrap-icons.version'     : '1.13.1',
             'bootstrap.version'           : '5.3.8',
-            'commons-codec.version'       : '1.19.0',
+            'commons-codec.version'       : '1.21.0',
             'commons-lang3.version'       : '3.20.0',
             'geb-spock.version'           : '8.0.1',
             'groovy.version'              : '4.0.31',
 
             'jquery.version'              : '3.7.1',
             'liquibase-hibernate5.version': '4.27.0',
             'mongodb.version'             : '5.6.4',
+            // Selenium 4.41+ requires OpenTelemetry 1.59+, which is newer than the
+            // 1.55.x that Spring Boot 4.0.5 manages. Pin the version on the individual
+            // OpenTelemetry modules (see the constraints block in grails-bom/build.gradle)
+            // so the explicit constraint overrides whatever Spring Boot's imported BOM
+            // declares, regardless of platform import ordering.
+            'opentelemetry.version'       : '1.59.0',
             'rxjava.version'              : '1.3.8',
             'rxjava2.version'             : '2.2.21',
             'rxjava3.version'             : '3.1.12',
-            'selenium.version'            : '4.38.0',
+            'selenium.version'            : '4.41.0',

Review Comment:
   We had pinned selenium to .38 due to the geb issues.  Do we know if these are resolved?



##########
settings.gradle:
##########
@@ -20,6 +20,23 @@ import org.apache.tools.ant.DirectoryScanner
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   We should use https://github.com/apache/grails-core/pull/15597 instead



##########
dependencies.gradle:
##########
@@ -22,15 +22,16 @@
 // These files are split to facilitate separation of build vs application dependencies. These are the application dependencies.
 ext {
     gradleBomDependencyVersions = [
-            'ant.version'                   : '1.10.15',
+            'ant.version'                   : '1.10.17',
             'asciidoctor-gradle-jvm.version': '4.0.5',
             'asciidoctorj.version'          : '3.0.0',
             'asset-pipeline-gradle.version' : '5.1.0-M4',
-            'byte-buddy.version'            : '1.17.8',
-            'commons-text.version'          : '1.14.0',
+            'byte-buddy.version'            : '1.18.8',
+            'commons-text.version'          : '1.15.0',
             'directory-watcher.version'     : '0.19.1',
-            'gradle-spock.version'          : '2.3-groovy-3.0',
-            'grails-publish-plugin.version' : '0.0.4',
+            'gradle-groovy.version'         : '4.0.31',

Review Comment:
   This should be GroovySystem version instead of hard coding.



##########
buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {
+        mavenCentral()
+        gradlePluginPortal()
+        // Needed to resolve grails-publish snapshots that the build-logic composite

Review Comment:
   We should take https://github.com/apache/grails-core/pull/15597 instead of these changes.



##########
grails-gradle/buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {

Review Comment:
   We should use https://github.com/apache/grails-core/pull/15597 instead



##########
gradle.properties:
##########
@@ -50,8 +50,8 @@ yakworksHibernateGroovyProxyVersion=1.1
 # Build dependency versions not managed by BOMs
 apacheRatVersion=0.8.1
 gradleChecksumPluginVersion=1.4.0
-# note: the cyclonedx 3 requires Gradle 9
-gradleCycloneDxPluginVersion=2.4.1
+# CycloneDX Gradle plugin version

Review Comment:
   Remove the comment



##########
grails-forge/buildSrc/settings.gradle:
##########
@@ -17,6 +17,23 @@
  *  under the License.
  */
 pluginManagement {
+    repositories {

Review Comment:
   We should use https://github.com/apache/grails-core/pull/15597 instead



##########
dependencies.gradle:
##########
@@ -73,20 +75,26 @@ ext {
             'asset-pipeline-bom.version'  : '5.1.0-M4',
             'bootstrap-icons.version'     : '1.13.1',
             'bootstrap.version'           : '5.3.8',
-            'commons-codec.version'       : '1.19.0',
+            'commons-codec.version'       : '1.21.0',
             'commons-lang3.version'       : '3.20.0',
             'geb-spock.version'           : '8.0.1',
             'groovy.version'              : '4.0.31',
 
             'jquery.version'              : '3.7.1',
             'liquibase-hibernate5.version': '4.27.0',
             'mongodb.version'             : '5.6.4',
+            // Selenium 4.41+ requires OpenTelemetry 1.59+, which is newer than the

Review Comment:
   Is this upgrade just to prevent conflicts with forge's version of micronaut? 



##########
grails-forge/settings.gradle:
##########
@@ -19,6 +19,23 @@
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   We should use https://github.com/apache/grails-core/pull/15597 instead



##########
grails-forge/grails-forge-api/build.gradle:
##########
@@ -47,8 +48,8 @@ dependencies {
     api 'io.micronaut:micronaut-http-client'
     api 'io.micronaut:micronaut-inject'
     api 'io.micronaut:micronaut-runtime'
-    api 'io.micronaut:micronaut-validation'
-    api group: 'javax.inject', name: 'javax.inject', version: '1'
+    api 'io.micronaut.validation:micronaut-validation'
+    api "jakarta.inject:jakarta.inject-api:$jakartaInjectVersion"

Review Comment:
   So the jakarta api is defined in the micronaut platform, but not the inject version.  Is inject included transitively by the bom dependencies?  I'm worried about mismatching this version vs what's in their bom.



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -968,12 +975,17 @@ ${importStatements}
     @CompileDynamic
     protected TaskProvider<Task> createNative2AsciiTask(TaskContainer tasks, src, dest) {
         TaskProvider<Task> native2asciiTask = tasks.register('native2ascii').configure {
+            it.inputs.dir(src)
+            it.outputs.dir(dest)
+
+            // Capture ant builder at configuration time to avoid Task.project access at execution time

Review Comment:
   Let's remove the comment, it's obvious once we're on Gradle 9 why we did this.



##########
grails-bom/build.gradle:
##########
@@ -107,6 +107,8 @@ configurations.register('bomDependencies').configure {
 }
 
 tasks.register('extractConstraints', ExtractDependenciesTask).configure { ExtractDependenciesTask it ->
+    // Capture project services at configuration time so the task avoids the deprecated Task.project at execution time

Review Comment:
   This comment is "this is bridge" , let's remove it.



##########
grails-gradle/settings.gradle:
##########
@@ -19,14 +19,31 @@
 import org.gradle.api.initialization.resolve.RepositoriesMode
 
 pluginManagement {
+    repositories {

Review Comment:
   We should use https://github.com/apache/grails-core/pull/15597 instead



##########
grails-forge/test-core/build.gradle:
##########
@@ -59,15 +59,15 @@ dependencies {
         testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"
     }
 
-    testImplementation "org.codehaus.groovy:groovy:$groovyVersion"
+    testImplementation "org.apache.groovy:groovy:$groovyVersion"

Review Comment:
   This doesn't look fixed, the groovyVersion is still being reference.  The micronaut bom includes `groovy-bom` so the versions should be unneccessary in forge unless there is a version mismatch.  Also, since the recent patches of groovy, we know it's important to use the same version.  I was proposing we drop the property groovyVersion and use the micronaut bom instead.



##########
grails-forge/grails-forge-analytics-postgres/build.gradle:
##########
@@ -18,7 +18,6 @@
  */
 
 plugins {
-    id 'com.gradleup.shadow'
     id 'org.apache.grails.buildsrc.properties'

Review Comment:
   The shadow plugin is used to create a fat jar, why was it removed?  



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -45,3 +41,61 @@ apply {
     from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Root-cause fix for duplicate META-INF/spring-configuration-metadata.json:
+//
+// This plugin intentionally exposes both a Java bean (PluginJavaMicronautBean) and a
+// Groovy bean (PluginGroovyMicronautBean) that share the @ConfigurationProperties('my')
+// prefix to exercise the original issue 11767 scenario. As a side effect, two different
+// Micronaut tools produce the same metadata file:
+//   - micronaut-inject-java runs as a Java annotation processor during compileJava and
+//     writes build/classes/java/main/META-INF/spring-configuration-metadata.json
+//     describing PluginJavaMicronautBean.
+//   - micronaut-inject-groovy (pulled in transitively via grails-micronaut) runs as a
+//     Groovy AST transform during compileGroovy and writes
+//     build/classes/groovy/main/META-INF/spring-configuration-metadata.json describing
+//     PluginGroovyMicronautBean.
+// The two files are not equivalent: each describes the beans visible to its own compiler.
+// The shared CompilePlugin convention sets jar.duplicatesStrategy = FAIL so the build
+// surfaces any double-configuration. Here the duplicate is by design, so we merge the
+// two JSON documents into a single file (preserving every group / property / hint) and
+// remove the now-merged source so the jar task sees exactly one metadata file. This is
+// preferable to dropping one of the documents (DuplicatesStrategy.EXCLUDE) because that
+// would silently lose the bean type information for one of the languages.
+def mergeMicronautConfigMetadata = tasks.register('mergeMicronautConfigMetadata') {
+    description = 'Merges the spring-configuration-metadata.json emitted separately by ' +
+            'micronaut-inject-java and micronaut-inject-groovy into one combined document.'
+    group = 'build'
+
+    def metadataRelativePath = 'META-INF/spring-configuration-metadata.json'
+    def javaMetadataProvider = layout.buildDirectory.file("classes/java/main/${metadataRelativePath}")
+    def groovyMetadataProvider = layout.buildDirectory.file("classes/groovy/main/${metadataRelativePath}")
+
+    // Re-run whenever either compile step emits new metadata; the task mutates files
+    // inside the compile output directories so we cannot rely on standard up-to-date
+    // tracking. The work is cheap (two small JSON files) so always running is acceptable.
+    outputs.upToDateWhen { false }

Review Comment:
   This is the incorrect way to do this.  we should be able to cache these merges, otherwise it will always run this in our build.



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy:
##########
@@ -87,9 +87,14 @@ class GrailsProfileGradlePlugin implements Plugin<Project> {
         project.configurations.named('runtimeElements')
                 .configure { it.extendsFrom(runtimeOnlyConfiguration.get()) }
 
-        TaskProvider<Task> processProfileResourcesTask = project.tasks.register('processProfileResources')
-        processProfileResourcesTask.configure { Task task ->
+        // Use Sync task type instead of project.sync in doLast to avoid Task.project access at execution time

Review Comment:
   Let's remove the comment, it's unnecessary



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3129207820


##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in the sbom
                 // see: https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid deprecated Task.project access at execution time
+                // See: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   @jdaugherty Are you sure this is necessary? Will the values ever be differerent at configuration vs execution time?



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4102342505

   ## ✅ All tests passed ✅
   
   🏷️ Commit: b5a833ac6a937bb0ae3cb82798b84e6db3280362
   ▶️ Tests:  1028 executed
   ⚪️ Checks: 34/34 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4103272212

   ## 🔎 No tests executed 🔎
   
   🏷️ Commit: 53a531274a6df1f62899363f61f54b8fa1e81231
   ▶️ Tests:  0 executed
   🟡 Checks: 0/29 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4158358332

   ## 🔎 No tests executed 🔎
   
   🏷️ Commit: f23504712ca1302ecbd5616b79713863e34f3f95
   ▶️ Tests:  0 executed
   🟡 Checks: 0/30 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-4262076737

   @jamesfredley on the telemetry version, why not just override the version in our bom and bump it?  I don't think there is a guarantee that ordering of the guarantees dependency order - I had issues with this on the hibernate PR.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.4.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3137475534


##########
grails-forge/grails-forge-api/build.gradle:
##########
@@ -57,22 +58,23 @@ dependencies {
     testImplementation 'io.micronaut:micronaut-http-client'
     testImplementation 'io.micronaut:micronaut-http-server-netty'
     testImplementation 'io.micronaut.test:micronaut-test-spock'
+    testRuntimeOnly 'io.micronaut:micronaut-jackson-databind'
 
     testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"

Review Comment:
   Fixed in the latest commit. `grails-forge-api/build.gradle` already imports `io.micronaut.platform:micronaut-platform` as a platform, so `testCompileOnly 'io.micronaut:micronaut-inject-groovy'` is now unversioned and the duplicated `if (project.hasProperty('micronautVersion')) { ... }` block (which was a no-op copy of the line above) has been removed. Resolving.



##########
grails-forge/grails-forge-cli/build.gradle:
##########
@@ -68,10 +68,10 @@ ext {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
+    implementation platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Fixed in the latest commit. `grails-forge-cli/build.gradle` already imports `io.micronaut.platform:micronaut-platform` as a platform, so the `testCompileOnly 'io.micronaut:micronaut-inject-groovy'` reference is now unversioned and the redundant `if (project.hasProperty('micronautVersion')) { ... }` guard has been dropped. Resolving.



##########
grails-forge/grails-forge-core/build.gradle:
##########
@@ -41,13 +41,15 @@ sourceSets {
 }
 
 dependencies {
-    annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Fixed in the latest commit. `grails-forge-core/build.gradle` already imports `io.micronaut.platform:micronaut-platform` as a platform, so `testCompileOnly 'io.micronaut:micronaut-inject-groovy'` is now unversioned and the redundant `if (project.hasProperty('micronautVersion')) { ... }` guard has been dropped. Resolving.



##########
grails-forge/grails-forge-web-netty/build.gradle:
##########
@@ -32,6 +31,7 @@ dependencies {
     implementation 'io.micronaut.gcp:micronaut-gcp-http-client'
 
     runtimeOnly 'ch.qos.logback:logback-classic'
+    runtimeOnly 'io.micronaut:micronaut-jackson-databind'

Review Comment:
   Good catch - forge is a serde-jackson app, the jackson-databind runtime was a template leftover. Fixed in the latest commit: `runtimeOnly 'io.micronaut:micronaut-jackson-databind'` -> `runtimeOnly 'io.micronaut.serde:micronaut-serde-jackson'`. The `testCompileOnly` line on `micronaut-inject-groovy` has also been switched to the BOM-managed variant. Resolving.



##########
grails-forge/test-core/build.gradle:
##########
@@ -59,15 +59,15 @@ dependencies {
         testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"
     }
 
-    testImplementation "org.codehaus.groovy:groovy:$groovyVersion"
+    testImplementation "org.apache.groovy:groovy:$groovyVersion"

Review Comment:
   Fixed in the latest commit. `test-core/build.gradle` now imports `io.micronaut.platform:micronaut-platform` for both `implementation` and `testImplementation`, and all `io.micronaut:micronaut-inject-groovy` references are unversioned. Resolving.



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy:
##########
@@ -248,19 +249,17 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
         project.afterEvaluate() {
             ProcessResources processResources = (ProcessResources) project.tasks.getByName('processResources')
 
-            def processResourcesDependencies = []
-
-            processResourcesDependencies << project.task(type: Copy, 'copyCommands') {
+            TaskProvider<Copy> copyCommands = project.tasks.register('copyCommands', Copy) {
                 from("${project.projectDir}/src/main/scripts")
                 into("${processResources.destinationDir}/META-INF/commands")
             }
 
-            processResourcesDependencies << project.task(type: Copy, 'copyTemplates') {
+            TaskProvider<Copy> copyTemplates = project.tasks.register('copyTemplates', Copy) {
                 from("${project.projectDir}/src/main/templates")
                 into("${processResources.destinationDir}/META-INF/templates")
             }
             processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
-            processResources.dependsOn(*processResourcesDependencies)
+            processResources.dependsOn(copyCommands, copyTemplates)

Review Comment:
   Intentional - the refactor on lines 252-257 changed `project.task(type: Copy, 'copyCommands') { ... }` to `project.tasks.register('copyCommands', Copy) { ... }` (and the same for `copyTemplates`) to migrate off the eager `project.task(...)` API that is problematic under Gradle 9 / configuration-cache. Because both task registrations are now captured as `TaskProvider<Copy>` locals (`copyCommands` / `copyTemplates`), the downstream `processResources.dependsOn(*processResourcesDependencies)` spread over a `def processResourcesDependencies = []` list is no longer needed - passing the two providers directly is both clearer and lazier. Not an AI style change. Resolving.



-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3824356175

   I did not touch SBOM in this PR.  Grails BOM Dependencies still generates during grails-doc build.  
   
   


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3824368803

   asciidoctor still results in a deprecation warning, which will be resolved in 5 https://github.com/asciidoctor/asciidoctor-gradle-plugin/releases


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Upgrade to Gradle 9.3.1 and Micronaut 4 [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#issuecomment-3825440947

   The reports in those other tickets claim that they execute but the wrong datasets are returned with gradle 9.  I would suggest diffing the output of those files and clearing any local cache before calling this a victory.


-- 
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: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org