From 6f04a8cfd6587b59f9ce62cfe575eafdc9f09501 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Mon, 13 Jul 2020 19:43:12 +0200 Subject: Fix javadoc rendering --- runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'runners/maven-plugin/src') diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index fdd1c646..5b904dce 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -166,7 +166,7 @@ abstract class AbstractDokkaMojo : AbstractMojo() { var failOnWarning: Boolean = DokkaDefaults.failOnWarning @Parameter - var dokkaPlugins: List = emptyList() + open var dokkaPlugins: List = emptyList() protected abstract fun getOutDir(): String @@ -243,7 +243,7 @@ abstract class AbstractDokkaMojo : AbstractMojo() { if (sourceSet.moduleDisplayName.isEmpty()) logger.warn("Not specified module name. It can result in unexpected behaviour while including documentation for module") }, pluginsClasspath = getArtifactByAether("org.jetbrains.dokka", "dokka-base", dokkaVersion) + - dokkaPlugins.map { getArtifactByAether(it.groupId, it.artifactId, it.version) }.flatten(), + dokkaPlugins.map { getArtifactByAether(it.groupId, it.artifactId, it.version ?: dokkaVersion) }.flatten(), pluginsConfiguration = mutableMapOf(), //TODO implement as it is in Gradle modules = emptyList(), failOnWarning = failOnWarning @@ -332,6 +332,9 @@ class DokkaMojo : AbstractDokkaMojo() { class DokkaJavadocMojo : AbstractDokkaMojo() { @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokkaJavadoc") var outputDir: String = "" + + override var dokkaPlugins = super.dokkaPlugins + javadocDependency + override fun getOutDir() = outputDir } @@ -389,6 +392,8 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo() { override fun getOutDir() = outputDir + override var dokkaPlugins = super.dokkaPlugins + javadocDependency + override fun execute() { super.execute() if (!File(outputDir).exists()) { @@ -415,3 +420,8 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo() { return javadocJar } } + +private val javadocDependency = Dependency().apply { + groupId = "org.jetbrains.dokka" + artifactId = "javadoc-plugin" +} -- cgit