Skip to content
Open
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
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,45 @@ versions:
grailsVersion: 7.0.0 > *
```

### Forge feature packs

If the main jar of a plugin release contains a Forge feature pack (`META-INF/grails-forge/feature.yml`, which the `grails-plugin` Gradle plugin packages from `src/main/forge`), the indexer adds a `pack` property to that version. It lets the Grails CLI select the feature of your plugin by its name (`grails create-app --features <name>`) without downloading every release to find it.

```yaml
versions:
- version: 4.1.0
date: 2026-11-20T10:00:00Z
grailsVersion: 10.0.0 > *
pack:
format: 1
kind: feature
name: my-feature
templateApi: 1
applicationTypes: # left out for a feature pack that is for every type
- web
compatibility:
grails: '[10.0.0,11.0.0)'
forge: '[10.0.0,11.0.0)'
sha256: 5f2c... # of the jar; the CLI refuses a jar with another one
```

The `pack` property is copied from the descriptor inside the jar, which is read as data only; nothing of the jar is executed. Only the properties shown are copied, and the `sha256` is that of the jar as it was downloaded. **Do not write or edit `pack` by hand**: the `sha256` is what ties the entry to one jar. A jar whose descriptor cannot be read gets no `pack` (the indexer logs a warning and goes on), and a jar whose `grails-plugin.xml` cannot be read keeps its `pack` and gets no `grailsVersion`.

`applicationTypes` holds the types of application the pack is for: `web`, `rest-api`, `web-plugin`, `plugin` and `rest-api-plugin`. A feature pack that declares none is for all of them and has no `applicationTypes`. A preset (`kind: preset`) is for one type, the `applicationType` of its descriptor, which is recorded as the one entry of `applicationTypes`. A type the indexer does not know is recorded as the descriptor names it, beside the others, and the indexer logs a warning: the pack keeps its entry for the types it is validly for, and the Grails CLI passes over a type it does not know.

The Grails CLI selects a pack by its `name`, and refuses a name that more than one plugin has until the plugin is named with it. A name therefore belongs to the first plugin that is indexed with it: the pack of a release of another plugin with that name is not recorded, and the indexer logs a warning. A feature and a preset can have the same name. To hand a name over to another plugin, remove the `pack` of every version of the plugin that holds it.

Versions that are already in the YAML file are only looked at again when the indexer is run with `--rescan-packs`, for example `groovy index-plugins.groovy --rescan-packs grails-plugins/com/example/my-plugin.yml`. It downloads the main jar of each of them and makes `pack` what the jar has: a version that was indexed before packs were recorded gets its `pack`, and a `pack` that is not what the indexer records of the jar is replaced or removed, with a warning.

#### For maintainers of this repository

A `pack` makes a feature name resolve to a jar that takes part in generating an application, so it is reviewed like code:

- In the "Update Plugin Index" pull request, look at each `pack` that is new: its `name` should be one the plugin can be expected to use, and not one that passes for another plugin or for a feature of Grails itself.
- In a pull request that adds or changes a `pack` by hand, do not accept the change. Run `groovy index-plugins.groovy --rescan-packs <the file>` on it, which restores what the jars have.

What the indexer records of a pack is tested by `groovy index-plugins-test.groovy`, which reads no plugin file and downloads no plugin.

## Updating Your Plugin

Once your plugin's YAML file is accepted and merged into this repository, the system will periodically scan for new plugin versions and update the `versions` list accordingly. You do not need to manually update the YAML file when you release a new version of your plugin.
Expand Down
Loading