Java Conventions

The no.conta.java-conventions plugin configures compilation and common dependencies for main and test.

The no.conta.test-output-conventions plugin adds parameters that more output when running tests.

Configure

build.gradle
plugins {
    id 'no.conta.java-conventions'
    id 'no.conta.test-output-conventions'
}
gradle.properties
lombokVersion=1.18.20
# junitVersion=5.12.2

Javadoc

On a JDK 23 or newer toolchain, javadoc runs with --no-fonts, so the javadoc jar does not bundle about 4 MB of web fonts. Older javadoc does not know the flag and runs without it.

Configurable properties

The plugin reads the following properties from gradle.properties. All have sensible defaults and are optional.

Property Default Description

groovyVersion

4.0.30

Groovy version for test compilation

spockVersion

2.3-groovy-4.0

Spock BOM version

junitVersion

5.12.2

JUnit BOM version (provides junit-platform-launcher)

bytebuddyVersion

1.17.5

ByteBuddy version for class mocking

objenesisVersion

3.5

Objenesis version for no-arg constructor mocking

lombokVersion

(not set)

Set to enable Lombok compile-time processing

logbackVersion

(not set)

Set to add Logback to test runtime

Properties marked (not set) are opt-in: the dependency is only added when the property is present.