aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
index 0412b8a7..16f6c83e 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
@@ -86,11 +86,14 @@ open class DokkaTask : DefaultTask() {
private var outputDiagnosticInfo: Boolean = false // Workaround for Gradle, which fires some methods (like collectConfigurations()) multiple times in its lifecycle
- private fun tryResolveFatJar(configuration: Configuration?): Set<File> {
+ private fun tryResolveFatJar(configuration: Configuration?, level: Int = 0): Set<File> {
+ val maxRetries = 10
return try {
configuration!!.resolve()
} catch (e: Exception) {
- project.parent?.let { tryResolveFatJar(configuration) } ?: throw e
+ if (level >= maxRetries)
+ throw IllegalStateException("Cannot resolve dokka fatjar! Make sure you have jcenter() in your repositories")
+ project.parent?.let { tryResolveFatJar(configuration, level + 1) } ?: throw e
}
}