Ji Sungbin
10/06/2022, 10:56 AMclass TestPlugin : Plugin<Project> {
override fun apply(project: Project) {
with(project) {
repositories {
maven(url = uri("<https://maven.pkg.jetbrains.space/public/p/compose/dev>"))
}
dependencies {
add(PLUGIN_CLASSPATH_CONFIGURATION_NAME, "land.sungbin:composable.reference.suppressor.plugin:1.0.0")
}
}
}
}
Vampire
10/06/2022, 11:17 AMVampire
10/06/2022, 11:17 AMJi Sungbin
10/06/2022, 11:23 AMVampire
10/06/2022, 11:24 AMwakingrufus
10/06/2022, 11:43 AMJi Sungbin
10/06/2022, 11:44 AM> Could not find org.jetbrains.compose.compiler:compiler:1.3.2-alpha01.
Searched in the following locations:
- <https://dl.google.com/dl/android/maven2/org/jetbrains/compose/compiler/compiler/1.3.2-alpha01/compiler-1.3.2-alpha01.pom>
- <https://repo.maven.apache.org/maven2/org/jetbrains/compose/compiler/compiler/1.3.2-alpha01/compiler-1.3.2-alpha01.pom>
- <https://plugins.gradle.org/m2/org/jetbrains/compose/compiler/compiler/1.3.2-alpha01/compiler-1.3.2-alpha01.pom>
Required by:
project :playground > land.sungbin.composable.reference.suppressor:land.sungbin.composable.reference.suppressor.gradle.plugin:1.0.3 > land.sungbin:composable.reference.suppressor.plugin:1.0.3
But I’m a little confused right now. Obviously, I was getting errors until I asked this question, but I’ve tried rebuilding it to give you the error message and it’s worked. The above error is from my past build log.
At the time of asking the question, I built using the plugin distributed in Maven, but to reproduce the error for you, I moved the code locally and built it using the local. Could this be why adding my repository didn’t work?
If you want to see the project code, you can see it here.Ji Sungbin
10/06/2022, 11:47 AMAre you sure that transitive dependency is hosted in that repo?Sure. Compose Compiler dependency is hosted in the JetBrain repository.
wakingrufus
10/06/2022, 11:51 AMVampire
10/06/2022, 11:52 AMplayground
plugin?
The dependency that is missing is a dependency of your plugin.
You cannot add a dependency your plugin needs in the actual code of the plugin, that's a hen-and-egg situation.
Also that plugin adds the repository to the repositories for production code, not for plugins.
As you can see from the error message, the searched repositories are google()
, mavenCentral()
, and gradlePluginPortal()
which you most probably configured as plugin repositories in your playground
projects settings script.
There you need to add the JB repository so that your plugin dependencies can be resolved.Ji Sungbin
10/06/2022, 11:59 AMYou cannot add a dependency your plugin needs in the actual code of the plugin, that’s a hen-and-egg situation. Also that plugin adds the repository to the repositories for production code, not for plugins.Ah, now I know the reason. Thank you so much! In addition, thanks to you, I learned a new expression: “hen-and-egg situation”. 😉