I am trying to upgrade my build to use latest vers...
# kotlin-dsl
c
I am trying to upgrade my build to use latest versions of Gradle and plugings. I switched from 7.2 (other projects from even earlier versions) to 8.5. Now I got the problem in the "plugins" section: it doesn't like "maven" plugin and expect it to be a function. This seems because the "maven" need to be configured to the specific repository. I need to use the mavenCentral and people on different resources suggesting to use "mavenCentral()", but my build.gradle.kts doesn't recognize this function at all. It complains:
Copy code
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public inline fun RepositoryHandler.mavenCentral(vararg args: Pair<String, Any?>): MavenArtifactRepository defined in org.gradle.kotlin.dsl
👏 1
Just in case, I updated to what I see the latest 8.10 version. Didn't help... 😒
1
t
The old
maven
plugin was replaced by
maven-publish
a while ago (it was already deprecated for some time in Gradle 7.2)
v
As a general recommendation, update to the latest patch version within the same major version, fix all deprecation warnings, then update to the latest patch version in the next major version and so on. Always considering release notes and uprgrade notes. This usually cares for a smooth update experience.
But actually, the
maven
plugin was not deprecated in 7.2
It was deprecated in Gradle 6 and was removed in Gradle 7.0, wasn't it?
c
Thanks. I guess I added new plugin "maven-publish" because it was suggested, but didn't remove the old one ("maven"). Now, I removed "maven" plugin and the problem disappered.
👍 1
👌 1