Description
Using the java-gradle-plugin adds gradleApi() as an api (or compileOnlyApi in Gradle 9.4) dependency.
This is problematic because:
Workaround:
set org.gradle.unsafe.suppress-gradle-api=true in your gradle.properties
echo 'org.gradle.unsafe.suppress-gradle-api=true' >> gradle.properties
Add the correct minimum version of Gradle you want to support:
dependencies {
compileOnlyApi("org.gradle.experimental:gradle-public-api-internal:$gradleVersion")
}
Or if if gradle-public-api-internal is not published for the version of Gradle you're targeting, you may use the Nokee redistributed artifacts:
dependencies {
compileOnlyApi("dev.gradleplugins:gradle-api:$gradleVersion")
}
Description
Using the
java-gradle-pluginaddsgradleApi()as anapi(orcompileOnlyApiin Gradle 9.4) dependency.This is problematic because:
gradle-apicontains multi-release bycode in unexpected locations which makes the class file version verification failWorkaround:
set
org.gradle.unsafe.suppress-gradle-api=truein yourgradle.propertiesAdd the correct minimum version of Gradle you want to support:
dependencies { compileOnlyApi("org.gradle.experimental:gradle-public-api-internal:$gradleVersion") }Or if if
gradle-public-api-internalis not published for the version of Gradle you're targeting, you may use the Nokee redistributed artifacts:dependencies { compileOnlyApi("dev.gradleplugins:gradle-api:$gradleVersion") }