Adrian Landborn
11/17/2025, 3:45 PMdependencies {
dokka(project(":xxx:foundation:"))
dokka(project(":xxx:design:"))
dokka(project(":xxx:icons:"))
}
...
// Project level Dokka setup
pluginManager.withPlugin("org.jetbrains.dokka") {
dokka {
pluginsConfiguration.versioning {
olderVersionsDir.set(layout.projectDirectory.dir("documentation/oldVersions"))
}
dokkaPublications.html {
outputDirectory.set(layout.projectDirectory.dir("documentation/html"))
includes.from("documentation/packages.md")
}
}
}
// Module level Dokka setup
allprojects {
val currentVersion = evaluateVersionName()
val currentYear = Calendar.getInstance().get(Calendar.YEAR)
pluginManager.withPlugin("org.jetbrains.dokka") {
dokka {
moduleName.set(project.name.replaceFirstChar { it.titlecase(Locale.getDefault()) }) // Capitalize first letter
dokkaSourceSets.configureEach {
includes.from("$projectDir/README.md")
sourceLink {
basePublicationsDirectory
localDirectory.set(file("src/main/java"))
reportUndocumented.set(true) // Outputs to console if there are any undocumented elements
skipEmptyPackages.set(true)
}
}
pluginsConfiguration.html {
customAssets.from("${rootProject.rootDir}/documentation/logo-icon.svg")
}
pluginsConfiguration.versioning {
version = currentVersion
// If true, the dropdown with versions will be shown on all pages. Will increase compile build time.
renderVersionsNavigationOnAllPages = true
}
}
}
Any ideas how to move forward? ๐Adrian Landborn
11/17/2025, 3:50 PM./gradlew dokkaGenerate with the new version the versions dropdown disappearsAdrian Landborn
11/17/2025, 4:20 PMtasks.dokkaHtml {
// This can be any persistent folder where
// you store documentation by version
val docVersionsDir = projectDir.resolve("documentation/oldVersions")
// The version for which you are currently generating docs
val currentVersion = evaluateVersionName()
// Set the output to a folder with all other versions
// as you'll need the current version for future builds
val currentDocsDir = docVersionsDir.resolve(currentVersion)
outputDirectory.set(currentDocsDir)
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
olderVersionsDir = docVersionsDir
version = currentVersion
}
doLast {
// This folder contains the latest documentation with all
// previous versions included, so it's ready to be published.
// Make sure it's copied and not moved - you'll still need this
// version for future builds
currentDocsDir.copyTo(projectDir.resolve("documentation/html"))
// Only once current documentation has been safely moved,
// remove previous versions bundled in it. They will not
// be needed in future builds, it's just overhead.
// currentDocsDir.resolve("older").deleteRecursively()
}
}Oleg Yukhnevich
11/19/2025, 8:30 AMversioning plugin in your project config like here.
Overall, you need to configure pluginsConfiguration.versioning only for the aggregated project; it does nothing for separate modules.Adrian Landborn
11/20/2025, 8:06 AMAdrian Landborn
11/20/2025, 9:04 AMdokkaHtmlPlugin("org.jetbrains.dokka:versioning-plugin")Adrian Landborn
11/20/2025, 1:56 PMAdrian Landborn
11/20/2025, 1:57 PMimport org.jetbrains.dokka.versioning.VersioningPlugin
import org.jetbrains.dokka.versioning.VersioningConfiguration
buildscript {
dependencies {
classpath("org.jetbrains.dokka:versioning-plugin:2.1.0")
}
}
tasks.dokkaHtml {
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
version = "1.5"
versionsOrdering = listOf("1.5", "1.4", "1.3", "1.2", "1.1", "alpha-2", "alpha-1")
olderVersionsDir = file("documentation/version")
olderVersions = listOf(file("documentation/alpha/alpha-2"), file("documentation/alpha/alpha-1"))
renderVersionsNavigationOnAllPages = true
}
}Oleg Yukhnevich
11/20/2025, 2:20 PMIs this part of the v1 solution or what am I missing?Yes, this example is outdated... For now, the best way is to take a look on the example project configured with DGPv2, that I shared before We are currently in the process of updating the documentation on kotlinlang and will update readme's on GH after that
Oleg Yukhnevich
11/20/2025, 2:21 PMSpecifically this section (and the more verbose example further down)With DGPv2, versioning plugin now has type-safe DSL
Adrian Landborn
11/20/2025, 2:30 PM