Gradle plugin

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.

PropertyTypeDefault
publishedModulesList<String>['api', 'common', 'bukkit']
shadowModulesList<String>['engine']
javaVersionInteger25
gitOrgNameStringgit-org-name from gradle.properties
gitRepositoryStringgit-repository from gradle.properties
pomUrlStringhttps://github.com/{gitOrgName}/{gitRepository}
developerIdStringnone; when empty the POM has no <developers> block
developerNameStringnone
developerUrlStringnone

Examples

The two lists start with a value, so you can extend or replace them:

build.gradle
mcengineBuild {
    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.gradle
mcengineBuild {
    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.gradle
mcengineBuild {
    publishedModules = []
    shadowModules = []
}

Errors

MessageCause
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 :apiThe plugin was applied in a module build.
← What it configures Publishing →