Configuration
Every value has a default, so the block is only needed where your build differs.
The mcengineBuild block
Set it in the root build.gradle, after the plugins { } block. Values are read when the first subproject is configured and are final from then on, so a module build cannot change them.
| Property | Type | Default |
|---|---|---|
publishedModules | List<String> | ['api', 'common', 'bukkit'] |
shadowModules | List<String> | ['engine'] |
javaVersion | Integer | 25 |
gitOrgName | String | git-org-name from gradle.properties |
gitRepository | String | git-repository from gradle.properties |
pomUrl | String | https://github.com/{gitOrgName}/{gitRepository} |
developerId | String | none; when empty the POM has no <developers> block |
developerName | String | none |
developerUrl | String | none |
Examples
The two lists start with a value, so you can extend or replace them:
build.gradlemcengineBuild {
publishedModules.add('tools') // extend the default
publishedModules = ['api', 'common', 'bukkit', 'tools'] // or replace it
}
A plugin that publishes only its API, builds on Java 21 and names its author in the POM:
build.gradlemcengineBuild {
publishedModules = ['api']
javaVersion = 21
pomUrl = 'https://example.github.io/example-plugin/'
developerId = 'example'
developerName = 'Example'
developerUrl = 'https://github.com/example'
}
A plugin that publishes nothing and shades nothing automatically:
build.gradlemcengineBuild {
publishedModules = []
shadowModules = []
}
Errors
| Message | Cause |
|---|---|
publishes to GitHub Packages but has no git-org-name (or git-repository) | A published module exists and neither gradle.properties nor the block names the repository. |
configures a whole build: apply it to the root project, not :api | The plugin was applied in a module build. |