Hello, friends. Gradle 8.8 release says it now <al...
# gradle
s
Hello, friends. Gradle 8.8 release says it now allows version catalog plugin aliases without a version. I've been doing:
Copy code
# In libs.versions.toml
[plugins]
kotlin-dsl = { id = "org.gradle.kotlin.kotlin-dsl" }

// In build.gradle.kts
plugins {
    alias(libs.plugins.kotlin.dsl) apply true
}
However, when building, Gradle outputs:
Copy code
* What went wrong:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (plugin dependency must include a version number for this source)
And when I come back with the version, it works properly. I was wondering if this was about plugin management dependency resolution, so I tried the following:
Copy code
// In settings.gradle.kts
pluginManagement {
    repositories { gradlePluginPortal() }
}
Yet, nothing happens. Does anyone have an ideia what I am missing? Thanks in advance
v
If you for example have a plugin in the classpath already for some reason, you can apply it without version. You probably can also apply built-in plugins without version. But the
kotlin-dsl
plugin is not a built- in plugin. It has a convenience syntax that applies it with the correct version for the current Gradle version. But if you try to apply it without version, that doesn't work
Also if a plugin is coming from
buildSrc
or an included build, it would work without version.
s
hmmmmmm I get it now. I obviously need a version in my case 🤦 Thanks, @Vampire
👌 1