Slackbot
12/15/2022, 1:45 PMLars Kaulen
12/15/2022, 2:05 PMVampire
12/15/2022, 3:03 PMEverything works but getting the dependency notation for the Gradle plugins is annoying.What is so annoying in using
<plugin id>:<plugin id>.gradle.plugin:<plugin version>
?
Of course it is not super convenient which is why those tickets exist and even a PR that will hopefully fix it.
But it's not that bad and you can write a helper function that does it for you easily.
Regarding the repositories, you could refactor out those repository declarations into another included build that you then use from within the build-logic
plugin and in the settings script of the main build.Philip W
12/15/2022, 3:55 PMgradle.plugin.com.github.johnrengelman:shadow:7.1.2
for com.github.johnrengelman.shadow
.
Upvoted both issues.
Okay, adding another includeBuild
just for the repos would be possible, but a little bit overkill for 4 lines. I already use a Settings
plugin in the build-logic
like this:
pluginManagement {
repositories {
maven(url = "<https://oss.sonatype.org/content/repositories/snapshots>")
mavenCentral()
gradlePluginPortal()
}
includeBuild("build-logic")
}
plugins {
id("MyRepos")
}
but applying the settings plugin MyRepos
without adding the repositories still fails.Vampire
12/15/2022, 3:57 PMBecause some plugins use another name, likeThats the coordinates of the actual code-containing artifact. Then you have an additional marker artifact for each plugin in that code artifact following that naming pattern, that is used to resolve from plugin id to some artifact, exactly.forgradle.plugin.com.github.johnrengelman:shadow:7.1.2
.com.github.johnrengelman.shadow
Vampire
12/15/2022, 3:59 PMbut applying the settings pluginYeah, that's hen-and-egg problem of course. If that settings plugin needs to come from a repo you have to declare the repo first.without adding the repositories still fails.MyRepos
Philip W
12/15/2022, 4:06 PMMyRepos
is declared in build-logic
too. Otherwise I would totally agree.