Generating Javadocs/KDocs with Maven

I can't seem to generate Javadocs or KDocs with Maven. I tried both:

  <plugin>   <groupId>org.apache.maven.plugins</groupId>   <artifactId>maven-javadoc-plugin</artifactId>   <version>2.7</version>   <configuration>           <excludePackageNames>*.internal</excludePackageNames>   </configuration>   </plugin>

           <plugin>            <groupId>org.jetbrains.kotlin</groupId>            <artifactId>kdoc-maven-plugin</artifactId>            <version>${kotlin.version}</version>            </plugin>

but no mattter how I try, I never see the Javadocs generated in target/, which is a problem since without them, I can’t push anything to Maven central.

Am I missing something obvious?


Cédric

1 Like

For an example of invoking KDoc see https://github.com/JetBrains/kotlin/blob/master/libraries/docs/apidoc/pom.xml

As far as I know, it is not possible to make it compatible with JavaDoc.

Here’s an extract from SonaType’s guidelines:

https://docs.sonatype.org/display/Repository/Central+Sync+Requirements

Sources and Javadoc

If, for some reason (for example, license issue or it's a Scala project), you can not provide -sources.jar or -javadoc.jar, please make fake -sources.jar or -javadoc.jar with simple README inside to pass the checking.

We don't want to disable the rules because some people tend to skip it if they have an option.

1 Like

Thanks, Andrey, I'll try this hack, but it's disappointing to have to do this.

I think it’s very important for Kotlin’s future to be able to push new projects to Maven Central and it should be as easy to do so as it is in Java.

I’m chatting with James about adding the :jar goal to the kdoc plug-in but I doubt he’ll have time to work on that. It’s probably not a lot of work but I think it should be a high priority.

2 Likes

This issue still is there.
Probably, now that Kotlin 1.0 is getting close to release date, Dokka plugin should be updated to generate the kdoc-artifact to publish them together with other artifacts in maven central repository.

:sob: Kotlin 1.0 has released, but this issue still is THERE

2 Likes