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.1.0 — Micronaut 5 conventions
The no.conta.micronaut-v5-*-conventions plugins build on Micronaut Gradle Plugin 5 and are no longer pre-release.
What changed
-
Micronaut Gradle Plugin in the v5 conventions upgraded from 4.6.2 to 5.0.2; the pre-release warning is gone.
-
Gradle wrapper upgraded to 9.8.2, also in the examples except the v3 one, which stays on 8.14.
-
Gradle daemon of this repository runs on Java 25, pinned in
gradle/gradle-daemon-jvm.properties. Onlymicronaut-v5-conventionsbuilds with Java 25; the other plugins still target Java 17 and load in a Gradle running on Java 17. Building this repository needs both JDK 17 and JDK 25 installed. -
Javadoc on a JDK 23 or newer toolchain runs with
--no-fontsthroughno.conta.java-conventions, so a javadoc jar no longer bundles about 4 MB of web fonts. A project that passes--no-fontsitself can drop that line on 2.1.0.
Consuming project migration (v5 conventions only)
-
Upgrade the Gradle wrapper to 9.3 or later:
./gradlew wrapper --gradle-version 9.8.2Do this first: Gradle before 9.1 cannot run on Java 25. -
Install Java 25 locally; Gradle does not download it.
-
Pin the Gradle daemon to it: add
gradle/gradle-daemon-jvm.propertieswithtoolchainVersion=25. -
Move the Micronaut version in
gradle.propertiesto a 5.x release. -
If
dockerBaseImageis set, point it at a Java 25 image.
Projects on the v3 or v4 conventions need none of this.
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.