Add Automatic-Module-Name jar manifests#15959
Conversation
Generate Automatic-Module-Name entries from build-logic for published modules. Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]
There was a problem hiding this comment.
Pull request overview
This PR adds JPMS-friendly Automatic-Module-Name entries to jar manifests via the shared build-logic compile convention, and documents the resulting module naming scheme in the upgrade guide.
Changes:
- Add
Automatic-Module-Namemanifest attribute generation toCompilePluginand introduce a derived/overridable module-name helper. - Add build-logic test coverage for the module-name derivation helper.
- Document automatic module naming and link it into the docs table of contents.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| grails-doc/src/en/guide/upgrading/automaticModuleNames.adoc | New upgrade note describing automatic module-name manifest entries and naming rules. |
| grails-doc/src/en/guide/toc.yml | Adds the new upgrade note to the docs navigation. |
| build-logic/plugins/src/test/groovy/org/apache/grails/buildsrc/CompilePluginSpec.groovy | Adds tests for automaticModuleName(Project) derivation and override. |
| build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/CompilePlugin.groovy | Adds Automatic-Module-Name manifest attribute logic and the automaticModuleName helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!jar.archiveClassifier.present) { | ||
| jar.manifest.attributes('Automatic-Module-Name': automaticModuleName(project)) | ||
| } |
|
|
||
| class CompilePluginSpec extends Specification { | ||
|
|
||
| void 'automatic module name is derived from group and project name'() { |
| @@ -0,0 +1,7 @@ | |||
| === Automatic module names | |||
|
|
|||
| Grails 8.1 starts publishing `Automatic-Module-Name` manifest entries for the main framework jars produced by the shared compile convention. | |||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.0.x #15959 +/- ##
==================================================
+ Coverage 49.5403% 49.5654% +0.0251%
- Complexity 16922 16929 +7
==================================================
Files 1999 1999
Lines 93754 93753 -1
Branches 16420 16419 -1
==================================================
+ Hits 46446 46469 +23
+ Misses 40145 40118 -27
- Partials 7163 7166 +3 🚀 New features to boost your workflow:
|
|
We cannot do this PR because we have overlapping module names. Until we repackage all of our jars, we cannot proceed here and thus is why we've excluded this information to date (we don't want to give the appearance we're compatible with JPMS until we actually are). |
🚨 TestLens detected 1 failed test 🚨Here is what you can do:
Test SummaryCI - Groovy Joint Validation Build / build_grails > :grails-test-examples-spring-security-core-misc-functional-test-app-group:integrationTest
🏷️ Commit: 7f4e24d Test FailuresSecuredControllerSpec > test login as sherlock, sherlock belongs to detective groups. All detectives have the role ADMIN (:grails-test-examples-spring-security-core-misc-functional-test-app-group:integrationTest in CI - Groovy Joint Validation Build / build_grails)Muted TestsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app. |
Description
What was found
Automatic-Module-NameWhat changed
Automatic-Module-Namein jar manifestsOut of scope / follow-up
module-info.javaRelated MD topics
Contributor Checklist
Issue and Scope
8.0.x.Code Quality
Licensing and Attribution
ai-generated-starting-pointlabel applied.Documentation
Assisted-by: Sisyphus:xai/grok-4.5 [gpt-coding]