From 3d6d8e7a5dad6c8aa26782b711d8bbb99261fd45 Mon Sep 17 00:00:00 2001 From: Julien Buret Date: Thu, 26 May 2016 17:02:35 +0200 Subject: Avoid crash when no javadoc generated --- maven-plugin/src/main/kotlin/DokkaMojo.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'maven-plugin/src/main') diff --git a/maven-plugin/src/main/kotlin/DokkaMojo.kt b/maven-plugin/src/main/kotlin/DokkaMojo.kt index aec6d852..e3736602 100644 --- a/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -148,6 +148,10 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo() { override fun execute() { super.execute() + if(!File(outputDir).exists()) { + log.warn("No javadoc generated so no javadoc jar will be generated") + return + } val outputFile = generateArchive("$finalName-$classifier.jar") if (attach) { projectHelper?.attachArtifact(project, "javadoc", classifier, outputFile) -- cgit