Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,30 @@
#### Build Status
- [![Java CI](https://github.com/grails/grails-wrapper/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails/grails-wrapper/actions/workflows/gradle.yml)

Update to the latest wrapper release based on Grails version
---

./grailsw update-wrapper

Versions
---

| Grails | Wrapper |
|---------------|---------------------------------------------------------------|
| 5.0.0 - 5.3.3 | [3.0.0.M1](https://github.com/grails/grails-wrapper/releases) |
| 5.3.4 - 5.3.X | [3.1.0](https://github.com/grails/grails-wrapper/releases) |
| 6.x.x | [4.0.0](https://github.com/grails/grails-wrapper/releases) |
| 7.x.x | [5.0.0](https://github.com/grails/grails-wrapper/releases) |
| 5.3.4 - 5.3.X | [3.1.x](https://github.com/grails/grails-wrapper/releases) |
| 6.x.x | [4.0.x](https://github.com/grails/grails-wrapper/releases) |
| 7.x.x | [6.0.x](https://github.com/grails/grails-wrapper/releases) |

Release Process
---

- Release new version via GitHub Releases
- After GitHub action is completed and only after the new release is visible on https://central.sonatype.com/artifact/org.grails/grails7-wrapper/versions
- Update the branch to trigger gradle.yml to publish the next snapshot which will update the release version on https://repo.grails.org/artifactory/core/org/grails/grails7-wrapper/maven-metadata.xml
- The release version will be installed locally by grails-wrapper.jar, latest is only used when release is not present

```xml
<latest>6.0.1-SNAPSHOT</latest>
<release>6.0.0</release>
```
8 changes: 7 additions & 1 deletion starter/src/main/java/grails/init/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ public static void main(String[] args) {
Authenticator.setDefault(new SystemPropertiesAuthenticator());

try {
if (!NO_VERSION_JAR.exists()) {
if (!NO_VERSION_JAR.exists() || (args.length > 0 && args[0].trim().equals("update-wrapper"))) {
System.out.println("Updating Grails wrapper jar to version: " + getVersion() + " located in: " + NO_VERSION_JAR.getAbsolutePath());
updateJar(getVersion());
// remove "update-wrapper" command argument
if(args.length > 0) {
args[0] = null;
}
}

URLClassLoader child = new URLClassLoader(new URL[]{NO_VERSION_JAR.toURI().toURL()});
Class<?> classToLoad = Class.forName("grails.init.RunCommand", true, child);
Method main = classToLoad.getMethod("main", String[].class);
Expand Down