You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/06/25 16:19:38 UTC

(grails-core) branch fix/sitemesh-stale-snapshot-bom created (now fc2100a5f1)

This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a change to branch fix/sitemesh-stale-snapshot-bom
in repository https://gitbox.apache.org/repos/asf/grails-core.git


      at fc2100a5f1 fix: prevent stale published grails-bom snapshot from downgrading sitemesh

This branch includes the following new commits:

     new fc2100a5f1 fix: prevent stale published grails-bom snapshot from downgrading sitemesh

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(grails-core) 01/01: fix: prevent stale published grails-bom snapshot from downgrading sitemesh

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch fix/sitemesh-stale-snapshot-bom
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit fc2100a5f1878490058672c7f0bae0654a2870cb
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Thu Jun 25 11:07:47 2026 -0500

    fix: prevent stale published grails-bom snapshot from downgrading sitemesh
    
    The gsp-spring-boot test app imports grails-bom via io.spring.dependency-management,
    which downloads the PUBLISHED snapshot from Nexus rather than the local project.  When
    a CI run publishes the BOM before the sitemesh version bump lands (or when a prior run
    publishes with the old version), the managed-version rule applies 3.2.2 — a version that
    has never been published for the spring-webmvc-sitemesh standalone artifact, which only
    exists starting at 3.3.0-M1.  This creates a circular deadlock: build fails → publish
    skipped → stale BOM stays on Nexus → next build fails.
    
    Fix: add a resolutionStrategy.eachDependency rule in functional-test-config.gradle that
    reads sitemesh version keys from the local grails-bom project ext (set after
    evaluationDependsOn completes) and applies them.  Because eachDependency rules are applied
    in registration order and this rule is registered after the spring plugin's rule, it takes
    precedence (last useVersion wins).
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
---
 gradle/functional-test-config.gradle | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gradle/functional-test-config.gradle b/gradle/functional-test-config.gradle
index 7f7e708a2a..78079c3047 100644
--- a/gradle/functional-test-config.gradle
+++ b/gradle/functional-test-config.gradle
@@ -21,6 +21,35 @@ rootProject.subprojects
         .findAll { !(it.name in testProjects) && !(it.name in docProjects) && !(it.name in cliProjects) }
         .each { project.evaluationDependsOn(it.path) }
 
+// After evaluationDependsOn, grails-bom is fully evaluated and its ext properties are set.
+// Read sitemesh versions to override any stale version from a published snapshot BOM.
+// The gsp-spring-boot test app imports the PUBLISHED grails-bom snapshot via
+// io.spring.dependency-management.  If that snapshot predates the sitemesh 3.3.0-M1 bump
+// (spring-webmvc-sitemesh only exists as a standalone artifact starting at 3.3.0-M1), the
+// plugin's managed-version rule silently downgrades to 3.2.2 which cannot be resolved.
+// This eachDependency rule runs after the spring plugin's rule and wins (last useVersion wins).
+def grailsBomProject = rootProject.subprojects.find { it.name == 'grails-bom' }
+Map localBomVersions = grailsBomProject?.hasProperty('bomDependencyVersions')
+        ? (grailsBomProject.bomDependencyVersions as Map)
+        : Collections.emptyMap()
+
+configurations.configureEach {
+    resolutionStrategy.eachDependency {
+        if (requested.group == 'org.sitemesh') {
+            String localVersion = null
+            if (requested.name == 'spring-webmvc-sitemesh') {
+                localVersion = localBomVersions['spring-webmvc-sitemesh.version']
+            } else if (requested.name == 'spring-boot-starter-sitemesh') {
+                localVersion = localBomVersions['starter-sitemesh.version']
+            }
+            if (localVersion) {
+                useVersion(localVersion)
+                because('Prevent stale published snapshot BOM from applying a non-existent sitemesh version')
+            }
+        }
+    }
+}
+
 configurations.configureEach {
     resolutionStrategy.dependencySubstitution {
         // Test projects will often include dependencies from local projects. This will ensure any dependencies