jamesfredley opened a new pull request, #15598:
URL: https://github.com/apache/grails-core/pull/15598

   ## Summary
   
   The `publish` job's **Verify grails-wrapper** step has failed on every push 
to `7.0.x` since 8.0.0-SNAPSHOT started being published to the Apache Maven 
snapshot repo.
   
   ### Root cause
   
   With `GRAILS_WRAPPER_ALLOWED_TYPES='SNAPSHOT'` and no preferred version, the 
wrapper reads `grails-cli`'s root `maven-metadata.xml`, sorts by 
`GrailsVersion` order, and picks the globally latest SNAPSHOT - currently 
`8.0.0-SNAPSHOT` from the main development branch. That jar is compiled with 
Java 21 (class file version 65.0), but the 7.0.x publish job runs on Java 17 
(class file version 61.0), producing:
   
   ```
   java.lang.UnsupportedClassVersionError: 
org/apache/grails/cli/DelegatingShellApplication
     has been compiled by a more recent version of the Java Runtime (class file 
version 65.0),
     this version of the Java Runtime only recognizes class file versions up to 
61.0
   ```
   
   ### Fix
   
   Pin the wrapper to the branch's own snapshot by:
   
   1. Reading `projectVersion` from the repo's `gradle.properties`
   2. Writing a minimal `gradle.properties` with 
`grailsVersion=<projectVersion>` into the wrapper's CWD (`build/`) before 
invoking `grailsw`
   
   `grails.init.GrailsVersion#getPreferredGrailsVersion` reads `grailsVersion` 
from `gradle.properties` in CWD and pins `GrailsUpdater` to that base version 
when resolving the snapshot, so 7.0.x verifies against 7.0.x snapshots, 7.1.x 
against 7.1.x, 8.0.x against 8.0.x, etc.
   
   ### Verification
   
   The failure pattern is reproducible in every recent push run:
   - 
https://github.com/apache/grails-core/actions/runs/24496413864/job/71598069598 
(Apr 16)
   - 
https://github.com/apache/grails-core/actions/runs/24487358870/job/71568765789 
(Apr 16)
   - 
https://github.com/apache/grails-core/actions/runs/24227501271/job/70735767232 
(Apr 10)
   
   This change is branch-portable - the same patch applies cleanly to 7.1.x / 
8.0.x because it derives the version from `projectVersion`.


-- 
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