'Different custom Gradle plugins are treated as the same
I have some common Gradle convention script plugins living in their own git repository. These are published to a nexus repository and all share the same group. For the sake of visualisation, this is how they look like:
com-mycorp.this-conventions.gradle.ktscom-mycorp.that-conventions.gradle.kts
On the nexus repository they can be found under:
com-mycorp/
├─ this-conventions.gradle.kts/
│ ├─ com-mycorp.this.conventions.gradle.kts/
│ │ ├─ 0.0.1
├─ that-conventions.gradle.kts/
│ ├─ com-mycorp.that.conventions.gradle.kts/
│ │ ├─ 0.0.1
The problem occurs when applying these plugins in my multi-module Gradle project.
For my own reasons, I need to apply one of these plugins at the root level (to be shared by all submodules) and the other only in on submodule. So this is how it looks like:
(root) build.gradle.kts
plugins {
id("com-mycorp.this-conventions") version "0.0.1" apply false
}
subprojects {
apply(plugin = "com-mycorp.this-conventions")
}
(submodule) build.gradle.kts
plugins {
id("com-mycorp.that-conventions") version "0.0.1" // doesn't work with version
}
As described in the comment, this doesn't work if I put the version there. I'm getting a message indicating that the plugin "is already on the classpath and must not include a version". But this makes no sense, because these are two different plugins but it seems they are somehow treated as the same. This works if I remove the version but I'm having trouble decoding why. Any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
