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. Only micronaut-v5-conventions builds 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-fonts through no.conta.java-conventions, so a javadoc jar no longer bundles about 4 MB of web fonts. A project that passes --no-fonts itself can drop that line on 2.1.0.

Consuming project migration (v5 conventions only)

  1. Upgrade the Gradle wrapper to 9.3 or later: ./gradlew wrapper --gradle-version 9.8.2 Do this first: Gradle before 9.1 cannot run on Java 25.

  2. Install Java 25 locally; Gradle does not download it.

  3. Pin the Gradle daemon to it: add gradle/gradle-daemon-jvm.properties with toolchainVersion=25.

  4. Move the Micronaut version in gradle.properties to a 5.x release.

  5. If dockerBaseImage is 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 buildSrc switched from groovy-3.0 to groovy-4.0 (Gradle 9 bundles Groovy 4).

  • JUnit BOM added to no.conta.java-conventions — Gradle 9 requires junit-platform-launcher on the test classpath explicitly. The version defaults to 5.12.2 and can be overridden via the junitVersion property in gradle.properties.

  • Task caching annotations added to all custom DefaultTask subclasses (@DisableCachingByDefault). @InputFile properties now declare @PathSensitive as required by Gradle 9’s stricter plugin validation.

  • Version resolution fix in reckon-conventions. Gradle 9 no longer auto-unwraps Provider objects passed to Project.setVersion(), causing project.version.toString() to return provider(?) instead of the resolved version. This contaminated archive names, jar filenames, and capability suffixes throughout the build. The fix resolves the version eagerly in afterEvaluate before applying it to all projects.

Consuming project migration

When upgrading a project to use this version:

  1. Upgrade the Gradle wrapper to 9.4.1: ./gradlew wrapper --gradle-version 9.4.1

  2. Replace any calls to project.exec {} with providers.exec {}.

  3. Replace artifacts.add('archives', …​) with a proper outgoing configuration.

  4. Remove any Provider.forUseAtConfigurationTime() calls.

  5. Ensure all Spock/Groovy dependencies use -groovy-4.0 variants.

  6. Update implementation 'no.conta.gradle:*' dependencies in precompiled script plugin projects to match the new version. The pluginManagement version in settings.gradle controls plugin ID resolution, but precompiled script plugins need the correct compile-time dependency.

  7. Verify that ./gradlew showVersion outputs a real version (e.g. 2.1.0-SNAPSHOT), not provider(?). If it shows provider(?), the reckon-conventions plugin is not at 2.0.0-rc.7 or later.