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

jamesfredley pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git


The following commit(s) were added to refs/heads/8.0.x by this push:
     new 57883c41e4 build: allow excluding the Spring DM example on an 
unpublished branch version
57883c41e4 is described below

commit 57883c41e4519b5e5cdbc6e6a9ef4a67a2c98f0f
Author: James Fredley <[email protected]>
AuthorDate: Thu Jul 30 11:34:46 2026 -0400

    build: allow excluding the Spring DM example on an unpublished branch 
version
    
    The Spring Dependency Management example imports grails-bom as a Maven BOM
    through io.spring.dependency-management, which resolves the import with its
    own detached configuration and so bypasses the local-project substitution in
    gradle/functional-test-config.gradle. settings.gradle already documented 
that
    this only works when org.apache.grails:grails-bom:<projectVersion> is 
already
    published, and already excluded the example during a reproducible release
    build for exactly that reason.
    
    A newly created release branch is the same condition. As soon as
    projectVersion is bumped to a version that has never been published, the BOM
    import resolves to nothing, every managed version comes back empty, and the
    build fails with "Could not find <group>:<artifact>:" - before CI can 
publish
    the snapshot that would fix it.
    
    Extend the existing guard with a presence-based -PbomSnapshotNotPublished so
    such a branch can exclude the example until its first snapshot publish
    succeeds. The default build graph is unchanged.
    
    Assisted-by: claude-code:claude-opus-5
---
 settings.gradle | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/settings.gradle b/settings.gradle
index 1b218ba6ce..aa32a4f3a2 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -618,7 +618,16 @@ project(':grails-test-examples-latency').projectDir = 
file('grails-test-examples
 // is not published anywhere yet, so the example cannot resolve its 
dependencies -
 // exclude it from the build graph entirely. It still builds and runs on every 
regular
 // CI build, where the -SNAPSHOT BOM is available from the Apache snapshots 
repository.
-if (!isReproducibleBuild) {
+//
+// A newly created release branch is the same condition: the moment 
projectVersion is
+// bumped to a version that has never been published, the BOM import silently 
resolves
+// to nothing, every managed version comes back empty, and the whole build 
fails with
+// "Could not find <group>:<artifact>:" - before CI can ever publish the 
snapshot that
+// would fix it. Set -PbomSnapshotNotPublished (or add it to 
gradle.properties) on such
+// a branch to exclude the example until its first snapshot publish succeeds, 
then drop
+// the flag again. The flag is presence-based; its value is ignored.
+def bomSnapshotNotPublished = 
providers.gradleProperty('bomSnapshotNotPublished').isPresent()
+if (!isReproducibleBuild && !bomSnapshotNotPublished) {
     include 'grails-test-examples-spring-dependency-management'
     project(':grails-test-examples-spring-dependency-management').projectDir = 
file('grails-test-examples/spring-dependency-management')
 }

Reply via email to