Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
75aced6
Upgrade to Spring Boot 4.2.0-M2
codeconsole Sep 26, 2026
9e98d99
Use NameGenerator, Spring Framework 7.1's name for ClassNameGenerator
codeconsole Sep 26, 2026
35e64e4
Implement getBean(String, ParameterizedTypeReference) in MockApplicat…
codeconsole Sep 26, 2026
31edfad
Pass only named types to graphql-java 26 as additional schema types
codeconsole Sep 26, 2026
ef48d42
Manage graphql-java 26.1, the version Spring Boot 4.2 selects
codeconsole Sep 26, 2026
e80fe40
Map the org.json version Jedis 8 uses to its LEGAL-666 license
codeconsole Sep 26, 2026
3cfe2c2
Inherit Jackson 3, Logback and Commons Codec from Spring Boot 4.2
codeconsole Sep 26, 2026
5ee6cc0
Describe the remaining overrides against Spring Boot 4.2's versions
codeconsole Sep 26, 2026
d9a9fae
Move the vulnerability scan exclusions to Spring Boot 4.2's versions
codeconsole Sep 26, 2026
3753d86
Document Spring Boot 4.2 and Spring Framework 7.1 in What's New
codeconsole Sep 26, 2026
fd9c4a9
Point the agent guides at Spring Boot 4.2 and Spring Framework 7.1
codeconsole Sep 26, 2026
7e79714
Merge 9.0.x into deps/spring-boot-4.2
codeconsole Oct 1, 2026
f84f587
Merge latest 9.0.x into deps/spring-boot-4.2
codeconsole Oct 1, 2026
20cafa0
Merge branch '9.0.x' into deps/spring-boot-4.2
codeconsole Oct 2, 2026
9ee20b6
Merge branch '9.0.x' into deps/spring-boot-4.2
codeconsole Oct 2, 2026
d7c05be
Merge branch '9.1.x' into deps/spring-boot-4.2
jamesfredley Oct 5, 2026
5d7b6ad
Use NameGenerator in the OpenAPI ahead-of-time spec
jamesfredley Oct 5, 2026
aabcc10
Keep the grails-developer skill's "Grails is built on" heading
codeconsole Oct 5, 2026
c3e575b
Drop the Spring Boot version from the BOM inheritance rule in AGENTS.md
codeconsole Oct 5, 2026
5d176de
Document the graphql-java 26 changes that reach GraphQL applications
codeconsole Oct 5, 2026
7b91b99
Limit the 9.1 upgrade note's deprecation rule to required arguments
codeconsole Oct 6, 2026
76626c9
Say Groovy YAML depends on Jackson 2.22.2 rather than requires it
codeconsole Oct 6, 2026
85e0ac8
Merge 9.0.x into deps/spring-boot-4.2
codeconsole Oct 12, 2026
ede220d
Drop the Tomcat and SLF4J pins that repeat Spring Boot 4.2.0-M2's ver…
codeconsole Oct 12, 2026
0180ce9
Describe the CVE-2026-47842 exclusion for Spring Security 7.2.0-M2
codeconsole Oct 12, 2026
07566b4
Make the upgrade notes the Grails 8 to Grails 9 guide
codeconsole Oct 12, 2026
fe8f6d0
Import ParameterizedTypeReference in MockApplicationContext
codeconsole Oct 12, 2026
9fbf63f
Sort the NameGenerator import in the OpenAPI ahead-of-time spec
codeconsole Oct 12, 2026
e378140
Read the forwarded scheme with Spring Framework 7.1's per-format parsers
codeconsole Oct 12, 2026
426e736
Document the Spring Boot 4.2 changes that affect Grails applications
codeconsole Oct 12, 2026
484b96f
Merge branch '9.0.x' into deps/spring-boot-4.2
codeconsole Oct 12, 2026
ab64bb9
Merge pull request #16408 from codeconsole/deps/spring-boot-4.2
jdaugherty Oct 13, 2026
79fa73e
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 13, 2026
829de60
Set the 9.1.x branch version to 9.1.0-SNAPSHOT and githubBranch to 9.1.x
jdaugherty Oct 13, 2026
5f5e961
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 14, 2026
f4c91db
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 14, 2026
ad6596c
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 14, 2026
51b663f
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 15, 2026
38bfb26
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 16, 2026
abd6beb
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 16, 2026
b7aaa5b
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 16, 2026
b1c3428
Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 16, 2026
72c9c06
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 19, 2026
8f7be5d
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 19, 2026
9f91caa
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 20, 2026
b77b984
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 20, 2026
b2851f3
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 21, 2026
ecf0ecb
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 21, 2026
5e109fd
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 22, 2026
80a84cc
[skip tests] Build the AOT generation context with NameGenerator in t…
jdaugherty Oct 22, 2026
d0e3635
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 22, 2026
da2feb4
Upgrade to Spring Boot 4.2.0-RC1
codeconsole Oct 23, 2026
1cecccd
Drop the MongoDB driver pin now that Spring Boot manages 5.13.0
codeconsole Oct 23, 2026
b3eace7
Describe the Jackson pins against Spring Boot 4.2.0-RC1
codeconsole Oct 23, 2026
1e4564c
Describe the CVE-2026-47842 exclusion against Spring Security 7.2.0-RC1
codeconsole Oct 23, 2026
699904f
Read the forwarded scheme with the two-argument ForwardedHeaderUtils …
codeconsole Oct 23, 2026
76b9be2
Leave the instance of a problem unset, as Spring Framework 7.1 does
codeconsole Oct 23, 2026
96cdc44
Point to the properties migrator's fail setting in the Grails 9 upgra…
codeconsole Oct 23, 2026
791bfcb
Drop the Logback pin now that Spring Boot manages 1.6.5
codeconsole Oct 23, 2026
6741911
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 23, 2026
87085ce
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 23, 2026
b47a295
Train the AOT cache against the executable war an application ships
codeconsole Oct 23, 2026
9a19923
Support a nonce-based Content-Security-Policy
codeconsole Oct 23, 2026
9dc7ea7
Say which attribute the nonce tags read when Spring Security renames …
codeconsole Oct 23, 2026
745d0a3
Merge remote-tracking branch 'upstream/9.1.x' into deps/spring-boot-4…
codeconsole Oct 23, 2026
3bafab6
Read Spring Security's CSP nonce through its registered interface
codeconsole Oct 23, 2026
5f76fe9
Render the nonce in the cspNonce tag through the same reader
codeconsole Oct 23, 2026
07f1a52
Document ContentSecurityPolicyNonce.nonceOf for code outside a view
codeconsole Oct 23, 2026
fa08677
Merge pull request #16738 from codeconsole/deps/spring-boot-4.2.0-RC1
jdaugherty Oct 23, 2026
e9266de
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 24, 2026
6fc33cc
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 24, 2026
587db8f
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 24, 2026
c18b588
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Oct 28, 2026
d6bfb8e
Read a compiled parent's data binding white list from the class
jdaugherty Oct 30, 2026
8fd2865
Merge branch '9.0.x' into 9.1.x
jdaugherty Nov 4, 2026
23807a0
Use NameGenerator in the reflection and plugin configuration AOT specs
jdaugherty Nov 4, 2026
a53d15f
Merge branch '9.0.x' into 9.1.x
jdaugherty Nov 5, 2026
7db7a81
[skip tests] Merge branch '9.0.x' into 9.1.x
jdaugherty Nov 5, 2026
d117049
Upgrade to Spring Boot 4.2.0-RC2
codeconsole Nov 5, 2026
991a702
Describe the Jackson pins against Spring Boot 4.2.0-RC2
codeconsole Nov 5, 2026
d67b11b
Describe the CVE-2026-47842 exclusion against Spring Boot 4.2.0-RC2
codeconsole Nov 5, 2026
8924593
Drop the json-smart CVE-2026-113602 exclusion now that Spring Boot ma…
codeconsole Nov 5, 2026
cdf0aa6
Manage ASM 9.11.1, which json-smart 2.6.1 depends on
codeconsole Nov 5, 2026
8731c9a
Re-declare Hibernate 7 at the 7.4.14.Final Spring Boot manages
codeconsole Nov 5, 2026
3a48ce0
Manage Hibernate ORM 7 at the version Spring Boot manages
codeconsole Nov 5, 2026
b4afca6
Keep requests browsers send on their own out of the request cache
codeconsole Nov 5, 2026
7180786
Support the HTTP QUERY method of Spring Framework 7.1
codeconsole Nov 5, 2026
7e3bd24
Write an exception no handler method handles as an RFC 9457 problem
codeconsole Nov 5, 2026
914f10a
Document X-Forwarded-Prefix and the buildpacks changes of Spring Boot…
codeconsole Nov 5, 2026
cf086d9
Run the exception handlers before writing a problem
codeconsole Nov 5, 2026
9770bdf
Handle what a request can run into while a problem is written
codeconsole Nov 5, 2026
711433b
Find the method a problem is written as where one is written
codeconsole Nov 5, 2026
337f89f
Test the error page for a browser, and correct what the guide says of…
codeconsole Nov 5, 2026
ebae2e3
Test how the plugin configures the request cache
codeconsole Nov 5, 2026
ecedbbb
Keep the example application's imports in order and its headers as th…
codeconsole Nov 5, 2026
bbcc94f
Test QUERY where its sibling methods are tested, and correct what the…
codeconsole Nov 5, 2026
e4ac442
Build a native image with what traceNativeMetadata records
codeconsole Nov 6, 2026
ab7e20c
Call GrailsWebRequest directly when resolving a MIME type
codeconsole Nov 6, 2026
637a737
Register HttpMethod for the comparison binding a command object makes
codeconsole Nov 6, 2026
18e67d2
Let traceNativeMetadata make requests with any method and body
codeconsole Nov 6, 2026
c551b18
Wait for an application that holds requests until it has started
codeconsole Nov 6, 2026
bf0406e
Let the Spring Security plugin build a native image
codeconsole Nov 6, 2026
e149ada
Let digest authentication start and sign users in
codeconsole Nov 6, 2026
0e5ca6d
Authenticate what a filter leaves unauthenticated before deciding access
codeconsole Nov 6, 2026
285fa77
Load what the embedded MongoDB's event loops need as it starts
codeconsole Nov 6, 2026
e517685
Register the response a refused method is answered through
codeconsole Nov 6, 2026
01fe15b
Give the training run of a spec time to start on a loaded machine
codeconsole Nov 6, 2026
5ef273a
Fill in a form's empty fields when tracing
codeconsole Nov 6, 2026
b1befee
Read a form's content type without failing on what a client sent
codeconsole Nov 6, 2026
8af7d92
Say in the upgrade guide that spring-boot-starter-amqp no longer mean…
codeconsole Nov 6, 2026
68f7825
Record an exception GrailsExceptionResolver handles on the HTTP serve…
codeconsole Nov 6, 2026
dd6e74b
Document the observability changes of Spring Boot 4.2
codeconsole Nov 6, 2026
c59ca3e
Keep a failed action's exception and route on the observation across …
codeconsole Nov 6, 2026
5c6c65b
Throw an action's own exception when it is invoked by reflection
codeconsole Nov 6, 2026
4c19027
Keep the resolver's observation comment true on every release line
codeconsole Nov 6, 2026
f4cc7eb
Keep the exception on the request after a forward to an error handler
codeconsole Nov 6, 2026
36f4967
Tell the observation's handlers about a failed action
codeconsole Nov 6, 2026
2bf0865
Tell the observation's handlers about an exception written as a problem
codeconsole Nov 6, 2026
54285c2
Load what Netty's leak detection needs before the embedded MongoDB's …
codeconsole Nov 6, 2026
b912584
Tell the handlers through the observation the filter keeps on the req…
codeconsole Nov 6, 2026
829e30b
Tell the handlers of an exception written as a problem in the same way
codeconsole Nov 6, 2026
d049b77
Record an exception an error handler answers on an asynchronous dispatch
codeconsole Nov 6, 2026
6476509
Recognise an asynchronous dispatch from an action forwarded to
codeconsole Nov 6, 2026
24ecc02
Keep the status of a wrapped exception when writing it as a problem
codeconsole Nov 6, 2026
34f91c1
Keep the route that failed when an error handler is routed
codeconsole Nov 7, 2026
bb6a5fe
Link the Spring Framework issue that asks for a public way to get the…
codeconsole Nov 7, 2026
28dc2dd
Set the route on the observation before an interceptor can fail
codeconsole Nov 7, 2026
adadd8f
Read only Spring Boot's own Hibernate entry while configuring the Hib…
codeconsole Nov 8, 2026
09cc09d
Stop saying an async timeout is recorded on the observation
codeconsole Nov 8, 2026
06fe2a8
Record a failure once on Undertow when the forward stays on the request
codeconsole Nov 8, 2026
f9316cf
Count what the observation handlers heard once the observation has st…
codeconsole Nov 9, 2026
15ad333
Decide whether to record a failure left on the request once the dispa…
codeconsole Nov 9, 2026
8e47942
Judge the observation of a failed request by what it carried when it …
codeconsole Nov 9, 2026
96ffe78
Write a problem with the advice for the controller the request is map…
codeconsole Nov 9, 2026
56d08d1
Report an Error an action throws, not the ServletException around it
codeconsole Nov 9, 2026
28a5485
Keep the route that failed when its error controller forwards
codeconsole Nov 9, 2026
f58e481
Leave an include out of the observation of the page that includes it
codeconsole Nov 9, 2026
4c27c50
Correct the upgrade note on routes, and drop an opt-out that does not…
codeconsole Nov 9, 2026
0842986
Wait up to 30 seconds for the observation in the failed-action specs
codeconsole Nov 9, 2026
bedc91f
Serve the embedded MongoDB's first request on the port it bound, what…
codeconsole Nov 9, 2026
da2ca8e
Move every Boot-managed Hibernate ORM module with hibernate7VersionOv…
codeconsole Nov 9, 2026
e161a31
Fill in an empty form field with a value its type accepts when tracing
codeconsole Nov 9, 2026
60db081
Send one of a select's options when tracing a form
codeconsole Nov 9, 2026
c72ff06
Say that the startup gate's 503 is temporary with Retry-After
codeconsole Nov 9, 2026
32a04aa
Wait for a 503 at startup only while it carries Retry-After
codeconsole Nov 9, 2026
073006e
Refuse a nativeMetadata request that cannot be made before starting t…
codeconsole Nov 9, 2026
90983ea
Compare what Digest authentication stores without replacing passwordE…
codeconsole Nov 9, 2026
909c6ed
Leave a signed-in user whose credentials were erased to the access de…
codeconsole Nov 9, 2026
ae1442e
Run the action that a forward during an async dispatch names
codeconsole Nov 9, 2026
bb900b9
Include the error handler for a failure inside an include
codeconsole Nov 9, 2026
05c49d0
Run the error controller for a failure included in a page whose URL h…
codeconsole Nov 9, 2026
2bf3e10
Wait for the redirected page in RedirectWithAndWithoutParamsFunctiona…
codeconsole Nov 9, 2026
9bf4e00
Type PromiseList.then and the GPath binding sources for Groovy 6.0.1
codeconsole Nov 10, 2026
50eadf1
Run the action an include names when no error is being handled
codeconsole Nov 10, 2026
02ef6dc
Give a page its state back after an include, and run what an error ha…
codeconsole Nov 10, 2026
d8f15f3
Give an included action its own id, and the page its namespace and at…
codeconsole Nov 10, 2026
a0e89c5
Merge branch '9.0.x' into 9.1.x
matrei Nov 11, 2026
36efe30
Merge branch '9.0.x' into 9.1.x
matrei Nov 11, 2026
2c4cf5d
Merge remote-tracking branch 'upstream/9.1.x' into deps/spring-boot-4…
codeconsole Nov 12, 2026
89e1609
Merge pull request #16871 from codeconsole/deps/spring-boot-4.2.0-RC2
codeconsole Nov 12, 2026
5657022
Merge branch '9.1.x' into 9.0.x
codeconsole Nov 12, 2026
a1a2265
Keep the 9.0.x branch version and githubBranch after merging 9.1.x
codeconsole Nov 12, 2026
91e777a
Merge branch '9.0.x' into merge/9.1.x-into-9.0.x
codeconsole Nov 12, 2026
55cfcda
Tag the Spring Boot 4.2 API @since 9.0, the release it first ships in
codeconsole Nov 12, 2026
1d04adf
Number the configuration key section of the Grails 9 upgrade guide 23
codeconsole Nov 12, 2026
76dc361
Fit a traced email or URL to the field's maxlength
codeconsole Nov 13, 2026
a122fe1
Keep a traced email or URL on example.com
codeconsole Nov 13, 2026
e2664a5
Warn when a field is too short for a traced email or URL
codeconsole Nov 13, 2026
f381153
Merge branch '9.0.x' into merge/9.1.x-into-9.0.x
codeconsole Nov 13, 2026
22fc54c
Keep the cached user's password when Digest authentication signs it in
codeconsole Nov 13, 2026
e164d65
Do not submit a form with a field too short to trace
codeconsole Nov 13, 2026
1c493e2
Store cached users by value instead of keeping a password on the sign…
codeconsole Nov 13, 2026
b6996ed
Let a native image copy the users the user cache stores
codeconsole Nov 13, 2026
e7e2c17
Keep the user cache readable by the Spring Security UI plugin
codeconsole Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/gradle-developer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ A module the parent manages through an imported BOM belongs to the property the
3. Use the unversioned coordinate in module `dependencies {}`.
4. Run `./gradlew :that-module:validateDependencyVersions` (and affected consumers).
5. Security overrides: comment with CVE and previous Boot version (see existing httpcore5/jackson/logback pins).
6. Hibernate ORM 7 has no pin: `grails-hibernate7-bom` reads the version `spring-boot-dependencies` manages and strictly re-declares `hibernateOrmModules` at it. To move ahead of a Spring Boot that lags behind, set `hibernate7VersionOverride` in `dependencies.gradle`; the BOM then strictly re-declares at it every `org.hibernate.orm` module `spring-boot-dependencies` manages in its own POM (`PomVersions.managedArtifactIds`), not only `hibernateOrmModules`, so `enforcedPlatform` consumers move the whole family as a Maven consumer setting `hibernate.version` does. `validateHibernateVersion` fails while it is not newer than Spring Boot's version, so a Boot bump that catches up forces its removal. It also fails when `hibernate-models.version` differs from the version the managed Hibernate ORM release depends on. Configuring the project reads only `spring-boot-dependencies`' own entry for `hibernate-core` (`PomVersions.managedVersion`), never the BOMs it imports, so a task that resolves none of them does not fail when one is missing from the cache; both checks resolve in the task's inputs, and `check` and the BOM's POM generation run it.

### Exclusions

Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ These human-review concerns are intentionally not mechanized; `validateRepositor
|-----------|---------|
| JDK | 21+ (baseline 21) |
| Groovy | 6.0.x |
| Spring Boot | 4.1.x |
| Spring Framework | 7.0.x |
| Spring Boot | 4.2.x |
| Spring Framework | 7.1.x |
| Spock | 2.5-groovy-6.0 |
| Gradle | 9.9.x |
| Jakarta EE | 10 |
Expand Down Expand Up @@ -152,7 +152,7 @@ All managed dependency versions live in `dependencies.gradle` (the single source
- **Only libraries the Grails project also works on may use a snapshot version.** Between releases, `dependencies.gradle` often points at a `-SNAPSHOT` or release-candidate version of one of our own libraries, such as the Asset Pipeline (`cloud.wondrify`), SiteMesh 3 (`org.sitemesh`), or the Grails Publish plugin (`org.apache.grails.gradle:grails-publish`). These are switched to their published version before a Grails release (see `RELEASE.md`). Do not suggest replacing them with a released version, and do not flag them in reviews. Never use a snapshot of any other library, such as Jackson or Spring. The snapshot repositories in `GrailsRepoSettingsPlugin` only serve the `org.apache.grails*`, `org.apache.groovy*`, `cloud.wondrify*`, and `org.sitemesh*` groups, so a snapshot of any other library will not resolve (unless `GRAILS_INCLUDE_MAVEN_LOCAL` is set for a local build). Do not widen those content filters to get one.
- **No dynamic versions in any BOM-bearing configuration.** The same task fails when any dependency of a BOM-bearing configuration is requested with a version range, a `+` prefix, or a `latest.*` selector, even when a BOM constraint overrides it (Gradle's own `failOnDynamicVersions()` misses that case). A dynamic version makes every resolution list the module's versions in the repository once the listing cache expires, which is every CI build, so the build depends on the repository answering even when every artifact is cached. Fix it where the range enters the graph: a build script of this repository pins the version or uses the BOM-managed coordinate; for a published module, exclude the module from that dependency and declare the BOM-managed coordinate next to it (see the `ehcache` declaration in `grails-spring-security`); a dependency *constraint* with a range (marked `(constraint)`, as Hibernate publishes for `log4j-core`) is not removed by an exclusion and needs a component metadata rule. `allowedDynamicVersions` (per-project ext, `group:name` keys) is the last resort, with a commented reason.
- **`groovy-callsite` is never a framework dependency.** Grails 9 compiles with invokedynamic, the Groovy 6 compiler's default, and does not ship `org.apache.groovy:groovy-callsite`; an application that opts out with `grails { indy = false }` declares the module itself, at the version the BOM manages. Do not add it to `grails-common` or any other module's `api` or `implementation`: every application would ship it. CI's `-PgrailsIndy=false` lanes get it from `CompilePlugin`, on every source set. A module whose tests load a library compiled with classic call sites, such as `testcontainers-spock`, declares it as `testRuntimeOnly` next to that library.
- **Prefer inheriting from the Spring Boot BOM.** Do not re-pin a coordinate that `spring-boot-dependencies` (4.1.x) already manages unless you are intentionally overriding it to a newer version (e.g. a security fix); note the reason inline.
- **Prefer inheriting from the Spring Boot BOM.** Do not re-pin a coordinate that `spring-boot-dependencies` already manages unless you are intentionally overriding it to a newer version (e.g. a security fix); note the reason inline.
- **An override of a Spring Boot managed version must use Spring Boot's property name, and must change the version.** `validateBomProperties` (plugin `org.apache.grails.buildsrc.bom-property-validator`, run in its own CI job) checks the POM each Grails BOM publishes against `spring-boot-dependencies` (`parentBoms` in `dependencies.gradle`). It fails when a pin is declared under a different property than the one Boot controls it with - for a module Boot manages through an imported BOM, that is the import's property (`jackson-bom.version`, not `jackson3.version`) - and when a pin repeats Boot's version. Rename the version key (and the dependency keys that must prefix it) or drop the pin.
- **Every version key must be used.** The same task (opt out with `-PskipBomPropertyValidation`, not `skipDependencyValidation`) fails when a version property a BOM owns (`bomVersionProperties` in each BOM's build script) is used by no entry of its published POM - a key no dependency references, or one whose dependency keys do not reduce to it. Delete the key or add the dependency that should use it. The few deliberate exceptions to these rules live, each with its reason, in `bomUnusedVersionExemptions` / `bomPropertyNameExemptions` / `bomRedundantVersionExemptions` in `dependencies.gradle`.
- **No two dependencies may provide the same class.** The `buildHealth` task (the `com.autonomousapps.build-health` settings plugin, configured in `gradle/dependency-analysis.settings.gradle`, which applies it to a build only when one of its tasks is requested by full name, so a plain build never pays for it) fails when two dependencies on a classpath provide the same fully qualified class name that the module's own code references, because compile and runtime behavior then depend on classpath order. The Build Health workflow runs it on every push and pull request, alongside the code style checks. Resolve a report by removing or excluding the redundant dependency; its other categories (unused or transitive dependencies, wrong configurations) are advice only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import java.util.regex.Pattern

import groovy.transform.CompileStatic

import org.gradle.api.GradleException

import org.apache.maven.model.Dependency
import org.apache.maven.model.Model
import org.apache.maven.model.io.xpp3.MavenXpp3Reader
Expand Down Expand Up @@ -68,6 +70,47 @@ class PomVersions {
dependency.scope == 'import'
}

/**
* Returns the version the model's own {@code <dependencyManagement>} gives {@code module}, a
* {@code group:artifact}, or {@code null} when it has no entry for it. The BOMs it imports are not
* read, so this resolves no other POM, and since a BOM's own entry wins over the ones it imports,
* a version found here is the one the BOM manages.
*
* @throws GradleException when the entry's version cannot be resolved from the model's own
* properties and the Maven built-ins
*/
static String managedVersion(Model model, String module) {
Map<String, String> properties = properties(model)
Dependency entry = managedDependencies(model).find { Dependency dependency ->
!isImport(dependency) && key(dependency, properties) == module
}
if (entry == null) {
return null
}
String version = interpolate(entry.version, properties)
if (!version) {
throw new GradleException("Cannot resolve ${module}:${entry.version.trim()}, managed by " +
"${properties['project.groupId']}:${model.artifactId}:${properties['project.version']}, from that POM's own properties.")
}
version
}

/**
* Returns the artifacts of {@code groupId} the model's own {@code <dependencyManagement>} manages, in
* the order it lists them. As with {@link #managedVersion}, the BOMs it imports are not read, so this
* resolves no other POM; {@code <pluginManagement>} is not read either, since it manages plugins.
* An entry whose coordinates cannot be resolved from the model's own properties is not included.
*/
static List<String> managedArtifactIds(Model model, String groupId) {
Map<String, String> properties = properties(model)
String prefix = "${groupId}:"
managedDependencies(model).findAll { Dependency dependency -> !isImport(dependency) }
.collect { Dependency dependency -> key(dependency, properties) }
.findAll { String module -> module?.startsWith(prefix) }
.collect { String module -> module.substring(prefix.length()) }
.unique()
}

/**
* The properties the model's coordinates and versions may refer to: its own
* {@code <properties>}, and the Maven built-ins, which are never declared there. A parent POM's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class SbomPlugin implements Plugin<Project> {
'pkg:maven/org.jline/jline-terminal-jni@3.30.16?type=jar' : 'BSD-3-Clause',
'pkg:maven/org.jruby/jzlib@1.1.5?type=jar' : 'BSD-3-Clause', // https://web.archive.org/web/20240822213507/http://www.jcraft.com/jzlib/LICENSE.txt shows it's a 3 clause
'pkg:maven/org.liquibase.ext/liquibase-hibernate5@4.27.0?type=jar': 'Apache-2.0', // maps incorrectly because of https://github.com/liquibase/liquibase/issues/2445 & the base pom does not define a license
'pkg:maven/org.json/json@20251224?type=jar' : 'Public-Domain', // required due to jedis, https://issues.apache.org/jira/browse/LEGAL-666 approves this usage
'pkg:maven/org.json/json@20260719?type=jar' : 'Public-Domain', // required due to jedis, https://issues.apache.org/jira/browse/LEGAL-666 approves this usage
// Bouncy Castle Licence is the MIT license (https://www.bouncycastle.org/licence.html); pulled in transitively by the CAS client
'pkg:maven/org.bouncycastle/bcpkix-jdk18on@1.84?type=jar' : 'MIT',
'pkg:maven/org.bouncycastle/bcprov-jdk18on@1.84?type=jar' : 'MIT',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/*
* 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.
*/

package org.apache.grails.buildsrc

import java.nio.file.Path

import org.gradle.api.GradleException
import spock.lang.Specification
import spock.lang.TempDir

import org.apache.maven.model.Model

/**
* Reads the version a BOM's own entries give a module, as {@code grails-hibernate7-bom} reads the
* Hibernate ORM version from {@code spring-boot-dependencies}:
*
* <pre>
* test:parent-bom:1.0, with test:grand-parent:1.0 as its parent
* test:lib-a ${lib-a.version} = 1.0
* test:lib-literal 5.0
* ${project.groupId}:lib-own ${project.version}
* test:lib-inherited ${inherited.version} - declared only by the parent POM
* other:lib-other 2.0
* test:lib-literal:tests 5.0 - the same artifact again, with a classifier
* test:family-bom ${family-bom.version} = 3.0, imported, and managing test:family-core
* test:test-maven-plugin 1.0 - in pluginManagement
* </pre>
*/
class PomVersionsSpec extends Specification {

@TempDir
Path testDir

Model bom

def setup() {
File pom = testDir.resolve('parent-bom-1.0.pom').toFile()
pom.text = '''<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent><groupId>test</groupId><artifactId>grand-parent</artifactId><version>1.0</version></parent>
<groupId>test</groupId>
<artifactId>parent-bom</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<properties>
<lib-a.version>1.0</lib-a.version>
<family-bom.version>3.0</family-bom.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency><groupId>test</groupId><artifactId>lib-a</artifactId><version>${lib-a.version}</version></dependency>
<dependency><groupId>test</groupId><artifactId>lib-literal</artifactId><version>5.0</version></dependency>
<dependency><groupId>${project.groupId}</groupId><artifactId>lib-own</artifactId><version>${project.version}</version></dependency>
<dependency><groupId>test</groupId><artifactId>lib-inherited</artifactId><version>${inherited.version}</version></dependency>
<dependency><groupId>other</groupId><artifactId>lib-other</artifactId><version>2.0</version></dependency>
<dependency><groupId>test</groupId><artifactId>lib-literal</artifactId><version>5.0</version><classifier>tests</classifier></dependency>
<dependency>
<groupId>test</groupId><artifactId>family-bom</artifactId><version>${family-bom.version}</version>
<type>pom</type><scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin><groupId>test</groupId><artifactId>test-maven-plugin</artifactId><version>1.0</version></plugin>
</plugins>
</pluginManagement>
</build>
</project>
'''
bom = PomVersions.read(pom)
}

def "an entry's version is resolved from the BOM's own properties and the Maven built-ins"() {
expect:
PomVersions.managedVersion(bom, module) == version

where:
module || version
'test:lib-a' || '1.0'
'test:lib-literal' || '5.0'
'test:lib-own' || '1.0'
}

def "a module the BOM has no entry for has no version"() {
expect:
PomVersions.managedVersion(bom, 'test:lib-unknown') == null
}

def "the BOMs it imports are not read, so a module only an imported BOM manages has no version"() {
expect: 'test:family-core, which only test:family-bom manages, and the imported BOM itself'
PomVersions.managedVersion(bom, 'test:family-core') == null
PomVersions.managedVersion(bom, 'test:family-bom') == null
}

def "an entry whose version only the parent POM declares fails instead of going unread"() {
when:
PomVersions.managedVersion(bom, 'test:lib-inherited')

then:
GradleException e = thrown()
e.message == 'Cannot resolve test:lib-inherited:${inherited.version}, managed by test:parent-bom:1.0, from that POM\'s own properties.'
}

def "the artifacts of a group are the ones the BOM's own entries list, in their order and each once"() {
expect: 'its own group resolved, and neither the BOM it imports, the plugin it manages nor the other group'
PomVersions.managedArtifactIds(bom, 'test') == ['lib-a', 'lib-literal', 'lib-own', 'lib-inherited']
PomVersions.managedArtifactIds(bom, 'other') == ['lib-other']
}

def "a group the BOM manages nothing of has no artifacts, whatever it shares a prefix with"() {
expect:
PomVersions.managedArtifactIds(bom, 'tes').isEmpty()
PomVersions.managedArtifactIds(bom, 'unknown').isEmpty()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ class SbomPluginSpec extends Specification {
'pkg:maven/org.jline/jansi@4.3.1?type=jar', bsd4Choice()).id == 'BSD-3-Clause'
}

void "org.json resolved through Jedis uses the public domain license approved in LEGAL-666"() {
given:
List publicDomainChoice = [[license: [name: 'Public Domain', url: 'https://github.com/stleary/JSON-java/blob/master/LICENSE']]]

expect:
SbomPlugin.pickLicense(LOGGER, 'grails-redis', 'grails-redis',
'pkg:maven/org.json/json@20260719?type=jar', publicDomainChoice).name == 'Public Domain'
}

void "JLine 4 license correction is limited to JLine 4 Maven jars"() {
when:
SbomPlugin.pickLicense(LOGGER, 'grails-console', 'grails-console', bomRef, bsd4Choice())
Expand Down
Loading
Loading