Skip to content

Configure Dokka for vanniktech maven publish javadoc generation#5

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-dokka-configuration-issue
Draft

Configure Dokka for vanniktech maven publish javadoc generation#5
Copilot wants to merge 2 commits intomainfrom
copilot/fix-dokka-configuration-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

The vanniktech.maven.publish plugin (v0.30.0) requires explicit Dokka configuration to generate javadocs for Android library modules. Build was failing on :persistence-sqlite:javaDocReleaseGeneration with InvocationTargetException.

Changes

  • Root build.gradle.kts: Added Dokka plugin declaration (v1.9.20, compatible with Kotlin 1.9.22)
  • Library modules (core, persistence-sqlite, network, protocol): Applied Dokka plugin and configured source sets with JDK 17 target
tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
    dokkaSourceSets.configureEach {
        jdkVersion.set(17)
        suppressInheritedMembers.set(false)
        suppressObviousFunctions.set(true)
    }
}

This enables javadoc artifact generation for Maven Central publication.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.5 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem

The CI/CD build is failing with the following error:

Task :persistence-sqlite:javaDocReleaseGeneration FAILED
FAILURE: Build failed with an exception.
Execution failed for task ':persistence-sqlite:javaDocReleaseGeneration'.
> A failure occurred while executing com.android.build.gradle.tasks.JavaDocGenerationTask$DokkaWorkAction
   > java.lang.reflect.InvocationTargetException (no error message)

This is happening on commit f5d0f19af0dcbf3dbf60378665d237013603677e when running the CI workflow.

Root Cause

The project uses com.vanniktech.maven.publish plugin version 0.30.0, which automatically configures Dokka for documentation generation. However, the current configuration is missing explicit Dokka plugin setup and configuration, causing Dokka to fail when generating JavaDoc for the Android library modules (particularly persistence-sqlite).

The failure occurs because:

  1. Dokka plugin is not explicitly declared in the root build.gradle.kts
  2. No Dokka configuration exists to handle Java 17/21 compatibility
  3. The vanniktech plugin expects proper Dokka setup for javadoc generation tasks

Solution Required

Reconfigure Dokka to work properly with the project:

  1. Add Dokka plugin to root build.gradle.kts:

    • Add id("org.jetbrains.dokka") version "1.9.20" apply false to the plugins block
  2. Configure Dokka in library modules:

    • Add the Dokka plugin to modules: core/build.gradle.kts, persistence-sqlite/build.gradle.kts, network/build.gradle.kts, and protocol/build.gradle.kts
    • Add this configuration after the android block in each library module:
    tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
        dokkaSourceSets.configureEach {
            jdkVersion.set(17)
            suppressInheritedMembers.set(false)
            suppressObviousFunctions.set(true)
        }
    }
  3. Ensure compatibility:

    • Use Dokka 1.9.20 which is compatible with Kotlin 1.9.22 (already in use)
    • Configure JDK version to match the project (Java 17)

Files to Modify

  • build.gradle.kts - Add Dokka plugin declaration
  • core/build.gradle.kts - Apply Dokka plugin and add configuration
  • persistence-sqlite/build.gradle.kts - Apply Dokka plugin and add configuration
  • network/build.gradle.kts - Apply Dokka plugin and add configuration
  • protocol/build.gradle.kts - Apply Dokka plugin and add configuration

Expected Outcome

After these changes:

  • The :persistence-sqlite:javaDocReleaseGeneration task should complete successfully
  • All library modules will generate proper JavaDoc documentation
  • The CI/CD pipeline will pass the build step
  • Maven Central publication will include proper documentation artifacts

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: mrdevrobot <12503462+mrdevrobot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Dokka configuration for JavaDoc generation Configure Dokka for vanniktech maven publish javadoc generation Jan 20, 2026
Copilot AI requested a review from mrdevrobot January 20, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants