dokka: Gradle plugin portal publishing can't find all dependencies?
There is a dokka plugin available on the Gradle plugin portal - https://plugins.gradle.org/plugin/org.jetbrains.dokka .
Both usages on the documentation do not work:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.dokka:gradle-plugin:0.9.13"
}
}
apply plugin: "org.jetbrains.dokka"
and
plugins {
id "org.jetbrains.dokka" version "0.9.13"
}
Both of these fail with:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'dokka-plugin-portal'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find org.jetbrains.dokka:integration:0.9.13.
Searched in the following locations:
https://plugins.gradle.org/m2/org/jetbrains/dokka/integration/0.9.13/integration-0.9.13.pom
https://plugins.gradle.org/m2/org/jetbrains/dokka/integration/0.9.13/integration-0.9.13.jar
Required by:
project : > org.jetbrains.dokka:gradle-plugin:0.9.13
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.247 secs
The first example is different than that in the current Readme.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}
apply plugin: 'org.jetbrains.dokka'
The classpath dependency for the buildscript points to org.jetbrains.dokka:dokka-gradle-plugin instead of that from the plugin portal which is org.jetbrains.dokka:gradle-plugin.
I wasn’t sure if the plugin portal was supported because I don’t see it in the documentation, but didn’t see another issue for this.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 22
- Comments: 27 (8 by maintainers)
Commits related to this issue
- Fix wrong maven coordinates on gradle plugin repo page GH-146 fixed — committed to Kotlin/dokka by semoro 7 years ago
- Use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Make it work This is basically a fix for https://github.com/Kotlin/dokka/issues/146 — committed to gradle/kotlin-relocation-test by lptr 7 years ago
- Make it work This is basically a fix for https://github.com/Kotlin/dokka/issues/146 — committed to gradle/kotlin-relocation-test by lptr 7 years ago
- Use JCenter first to resolve plugins This is a workaround for Kotlin/dokka#146. — committed to sdeleuze/spring-framework by sdeleuze 7 years ago
- Use `jcenter()` first in plugin dependency resolution due to Dokka POM issue see https://github.com/Kotlin/dokka/issues/146#issuecomment-354874977 — committed to mkobit/jenkins-pipeline-shared-libraries-gradle-plugin by mkobit 6 years ago
- Change order of repositories for plugin resolution to work around Kotlin/dokka#146 — committed to floscher/gradle-josm-plugin by floscher 6 years ago
- Use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Upgrade to Gradle 4.4.1 and use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Upgrade to Gradle 4.4.1 and use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Upgrade to Gradle 4.4.1 and use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Upgrade to Gradle 4.4.1 and use JCenter first to resolve plugins This works around https://github.com/Kotlin/dokka/issues/146 — committed to lptr/spek by lptr 7 years ago
- Upgrade to Gradle 4.4.1 and use JCenter first to resolve plugins (#356) This works around https://github.com/Kotlin/dokka/issues/146 — committed to spekframework/spek by lptr 6 years ago
- Fix #1264 build failed because dokka can't be found Fixed by upgrading dokka version https://github.com/Kotlin/dokka/issues/146#issuecomment-367668821 — committed to madgnome/reactor-core by madgnome 6 years ago
- fix #1264 Build failed because dokka plugin can't be found Fixed by upgrading dokka version See Kotlin/dokka#146 — committed to reactor/reactor-core by madgnome 6 years ago
Looks like
org.jetbrains.dokka:dokka-gradle-plugingets deployed with two different POMs:JCenter version (link):
Plugin portal version (link):
Fixed in 0.9.16
Please consider releasing a new version. The different POM issue brought up above by @lptr causes issues with Gradle in the workaround I posted above if
gradlePluginPortal()is searched beforejcenter()because of the broken POM.A workaround for treating it like a
plugins {}dependency can be done if you want to switch to the newer plugin style.Here is an example using Gradle 4.4-rc-6 (using 4.4 because
pluginManagement.repositorieswas switched toRepositoryHandler, which includes thejcenter()/mavenCentral()shortcuts):There is still an issue with
0.9.15:It seems that
org.jetbrains.dokka:integration:0.9.15is not published to Gradle Plugins repo.Workaround is to add for example
jcenter()repo:Is it intended or a bug?
@eriwen, if you’re still keen on helping. I think I might have found something.
As of now, the plugin is published in (at least) two different places: https://plugins.gradle.org/m2/org/jetbrains/dokka/dokka-gradle-plugin/0.9.15/ https://jcenter.bintray.com/org/jetbrains/dokka/dokka-gradle-plugin/0.9.15/
Looking at the archives, both of them are exactly the same, but somehow the accompanying pom file is different. In the plugins.gradle.org repository the pom file indicates a dependency on integration (which is never published anywhere, it’s always shadowed), but not on kotlin-runtime nor kotlin-reflect. In the jcenter version, we have two dependencies, one on kotlin-runtime, the other on kotlin-reflect, both being declared specifically as shadowed though.
https://github.com/Kotlin/dokka/blob/0.9.15/runners/gradle-plugin/build.gradle#L21-L24
So to summarise, reflect and runtime are shadowed but somehow seen as dependencies in jcenter, integration isn’t marked as shadowed but somehow is and is only seen as a dependency in gradle.org.
Any idea of what’s going on here?