Conta Gradle Plugins
Convenience plugins for Gradle, by Conta.
These plugins started out in the buildSrc directories of
internal projects. Why not share them?
Releasing
Plugins are automatically published to the Gradle Plugin Portal when a version tag is pushed.
Creating a release
First, ensure the build is successful:
./gradlew build
Then create and push the version tag:
./gradlew reckonTagCreate -Preckon.scope=minor -Preckon.stage=final
git push origin <tag>
Pushing the tag triggers the CI publish pipeline.
CI setup (maintainers)
The following protected, masked CI/CD variables must be configured in GitLab Settings > CI/CD > Variables:
-
GRADLE_PUBLISH_KEY— Gradle Plugin Portal API key -
GRADLE_PUBLISH_SECRET— Gradle Plugin Portal API secret
Tags matching ..* must be protected in Settings > Repository > Protected Tags.
Upgrade Notes
2.0.0 — Gradle 9 compatibility
This release adds compatibility with Gradle 9.4.1. It is not backwards-compatible with Gradle 8.x.
What changed
-
Gradle wrapper upgraded to 9.4.1.
-
Spock BOM in
buildSrcswitched fromgroovy-3.0togroovy-4.0(Gradle 9 bundles Groovy 4). -
JUnit BOM added to
no.conta.java-conventions— Gradle 9 requiresjunit-platform-launcheron the test classpath explicitly. The version defaults to5.12.2and can be overridden via thejunitVersionproperty ingradle.properties. -
Task caching annotations added to all custom
DefaultTasksubclasses (@DisableCachingByDefault).@InputFileproperties now declare@PathSensitiveas required by Gradle 9’s stricter plugin validation. -
Version resolution fix in
reckon-conventions. Gradle 9 no longer auto-unwrapsProviderobjects passed toProject.setVersion(), causingproject.version.toString()to returnprovider(?)instead of the resolved version. This contaminated archive names, jar filenames, and capability suffixes throughout the build. The fix resolves the version eagerly inafterEvaluatebefore applying it to all projects.
Consuming project migration
When upgrading a project to use this version:
-
Upgrade the Gradle wrapper to 9.4.1:
./gradlew wrapper --gradle-version 9.4.1 -
Replace any calls to
project.exec {}withproviders.exec {}. -
Replace
artifacts.add('archives', …)with a proper outgoing configuration. -
Remove any
Provider.forUseAtConfigurationTime()calls. -
Ensure all Spock/Groovy dependencies use
-groovy-4.0variants. -
Update
implementation 'no.conta.gradle:*'dependencies in precompiled script plugin projects to match the new version. ThepluginManagementversion insettings.gradlecontrols plugin ID resolution, but precompiled script plugins need the correct compile-time dependency. -
Verify that
./gradlew showVersionoutputs a real version (e.g.2.1.0-SNAPSHOT), notprovider(?). If it showsprovider(?), the reckon-conventions plugin is not at 2.0.0-rc.7 or later.