-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Description
Using the java-gradle-plugin adds gradleApi() as an api (or compileOnlyApi in Gradle 9.4) dependency.
This is problematic because:
gradle-apicontains multi-release bycode in unexpected locations which makes the class file version verification fail- It uses the version of Gradle you're using to build in your compile dependencies while you usually want conservative libraries with liberal tooling.
Workaround:
set org.gradle.unsafe.suppress-gradle-api=true in your gradle.properties
echo 'org.gradle.unsafe.suppress-gradle-api=true' >> gradle.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-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")
}
Metadata
Metadata
Assignees
Labels
No labels