We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new centralized dependency versions feature preview in Gradle 7 is pretty great, but there are a couple of places where libs doesn't resolve.
libs
In plugins in buildSrc, e.g. buildSrc/src/main/kotlin/MyPlugin.kt:
buildSrc/src/main/kotlin/MyPlugin.kt
class MyPlugin : Plugin<Project> { override fun apply(project: Project): Unit = project.run { dependencies { implementation(libs.groovy) testImplementation(libs.junit) [...] } [...] } }
The error I get ise: .../buildSrc/src/main/kotlin/MyPlugin.kt: (21, 32): Unresolved reference: libs
e: .../buildSrc/src/main/kotlin/MyPlugin.kt: (21, 32): Unresolved reference: libs
In dependencies/classpath in the root build.gradle.kts:
dependencies/classpath
build.gradle.kts
buildscript { [...] dependencies { classpath(libs.gradleVersionsPlugin) [...] } }
Error is Script compilation error: Line 27: classpath(libs.gradleVersionsPlugin) Unresolved reference: libs
Script compilation error: Line 27: classpath(libs.gradleVersionsPlugin) Unresolved reference: libs
In the root settings.gradle.kts:
settings.gradle.kts
plugins { id("com.gradle.enterprise").version(libs.versions.gradleEnterprise.get()) }
Throws approximately the same error as in pt. 2.
In the plugins block in buildSrc/build.gradle.kts:
buildSrc/build.gradle.kts
plugins { id("org.jmailen.kotlinter").version(libs.versions.kotlinter.get()) }
Is there a way to solve any of these?
SEO: enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("VERSION_CATALOGS")
The text was updated successfully, but these errors were encountered:
There are multiple issues here, it's better to create separate issues for each. However I don't think there's an immediate action to be taken. A follow-up for plugins (4) will be implemented. Please refer to my explanation on the forums: https://discuss.gradle.org/t/trouble-using-centralized-dependency-versions-in-buildsrc-plugins-and-buildscript-classpath/39421/2?u=cedricchampeau
Sorry, something went wrong.
No branches or pull requests
The new centralized dependency versions feature preview in Gradle 7 is pretty great, but there are a couple of places where
libs
doesn't resolve.In plugins in buildSrc, e.g.
buildSrc/src/main/kotlin/MyPlugin.kt
:The error I get is
e: .../buildSrc/src/main/kotlin/MyPlugin.kt: (21, 32): Unresolved reference: libs
In
dependencies/classpath
in the rootbuild.gradle.kts
:Error is
Script compilation error: Line 27: classpath(libs.gradleVersionsPlugin) Unresolved reference: libs
In the root
settings.gradle.kts
:Throws approximately the same error as in pt. 2.
In the plugins block in
buildSrc/build.gradle.kts
:Throws approximately the same error as in pt. 2.
Is there a way to solve any of these?
SEO:
enableFeaturePreview("VERSION_CATALOGS")
The text was updated successfully, but these errors were encountered: