aboutsummaryrefslogtreecommitdiff
path: root/maven-plugin/src/main/kotlin/DokkaMojo.kt
diff options
context:
space:
mode:
authorJulien Buret <jburet@gmail.com>2016-05-26 17:02:35 +0200
committerJulien Buret <jburet@gmail.com>2016-05-26 17:02:35 +0200
commit3d6d8e7a5dad6c8aa26782b711d8bbb99261fd45 (patch)
treeb31fb2be31adc28e7e3f659bf6b1f4efba7906ef /maven-plugin/src/main/kotlin/DokkaMojo.kt
parent0fc412aae215c7e54b99bc522ba656b12db5d1c5 (diff)
downloaddokka-3d6d8e7a5dad6c8aa26782b711d8bbb99261fd45.tar.gz
dokka-3d6d8e7a5dad6c8aa26782b711d8bbb99261fd45.tar.bz2
dokka-3d6d8e7a5dad6c8aa26782b711d8bbb99261fd45.zip
Avoid crash when no javadoc generated
Diffstat (limited to 'maven-plugin/src/main/kotlin/DokkaMojo.kt')
-rw-r--r--maven-plugin/src/main/kotlin/DokkaMojo.kt4
1 files changed, 4 insertions, 0 deletions
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)