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 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.