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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to