How to configure kdoc maven plugin


#1

Hi,

I am trying to get the kdoc-maven-plugin to work, added it to my pom

 
<plugin>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kdoc-maven-plugin</artifactId>
    <version>${kotlin.version}</version>
    <configuration>
        <title>API documentation for ${project.artifactId} ${project.version}</title>
        <sources>
            <source>src/main/kotlin</source>
        </sources>
    </configuration>
    <executions>
        <execution>
            <id>apidoc</id>
            <phase>install</phase>
            <goals>
                <goal>apidoc</goal>
            </goals>
        </execution>
    </executions>
</plugin>

But when I run it, it generates a stack overflow exception. Anyone have seen this problem?

[debug] Configuring the compilation environment
Warning: Caught exception finding function declarations on class(java.io.ObjectOutputStream) java.lang.StackOverflowError
java.lang.StackOverflowError
at org.jetbrains.kotlin.types.StarProjectionImpl$_type$1.<init>(StarProjectionImpl.kt)
at org.jetbrains.kotlin.types.StarProjectionImpl.<init>(StarProjectionImpl.kt:30)
at org.jetbrains.kotlin.types.TypeUtils.makeStarProjection(TypeUtils.java:587)
at org.jetbrains.kotlin.types.TypesPackage$StarProjectionImpl$81261954$starProjectionType$1.get(StarProjectionImpl.kt:44)
at org.jetbrains.kotlin.types.TypeSubstitutor.unsafeSubstitute(TypeSubstitutor.java:192)
at org.jetbrains.kotlin.types.TypeSubstitutor.substituteTypeArguments(TypeSubstitutor.java:281)
at org.jetbrains.kotlin.types.TypeSubstitutor.substituteCompoundType(TypeSubstitutor.java:245)
at org.jetbrains.kotlin.types.TypeSubstitutor.unsafeSubstitute(TypeSubstitutor.java:230)
at org.jetbrains.kotlin.types.TypeSubstitutor.substituteWithoutApproximation(TypeSubstitutor.java:158)
at org.jetbrains.kotlin.types.TypeSubstitutor.substitute(TypeSubstitutor.java:144)
at org.jetbrains.kotlin.types.TypeSubstitutor.substitute(TypeSubstitutor.java:138)
at org.jetbrains.kotlin.types.TypesPackage$StarProjectionImpl$81261954.starProjectionType(StarProjectionImpl.kt:48)
at org.jetbrains.kotlin.types.StarProjectionImpl$_type$1.invoke(StarProjectionImpl.kt:31)
at org.jetbrains.kotlin.types.StarProjectionImpl$_type$1.invoke(StarProjectionImpl.kt:22)
at kotlin.properties.LazyVal.get(Delegation.kt:169)
at org.jetbrains.kotlin.types.StarProjectionImpl.get_type(StarProjectionImpl.kt)
at org.jetbrains.kotlin.types.StarProjectionImpl.getType(StarProjectionImpl.kt:34)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)
at org.jetbrains.kotlin.doc.model.KModel.getType(KotlinModel.kt:652)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)
at org.jetbrains.kotlin.doc.model.KModel.getType(KotlinModel.kt:652)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)
at org.jetbrains.kotlin.doc.model.KModel.getType(KotlinModel.kt:652)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)
at org.jetbrains.kotlin.doc.model.KModel.getType(KotlinModel.kt:652)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)
at org.jetbrains.kotlin.doc.model.KModel.getType(KotlinModel.kt:652)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:1000)
at org.jetbrains.kotlin.doc.model.KType.<init>(KotlinModel.kt:993)


#2

Please don't use KDoc. It's no longer maintained and will be removed in the next milestone. The replacement documentation generator is Dokka: https://github.com/orangy/dokka

(It doesn’t have Maven integration at this time, but this is also planned for the next milestone.)


#3

Cool, thank you! I will just wait with this until you release the maven plugin.