diff options
author | freya02 <41875020+freya022@users.noreply.github.com> | 2023-10-18 22:33:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 22:33:01 +0200 |
commit | 8016c1face1283952e228aee348487bf0421ab90 (patch) | |
tree | 5216ef6a32e01ef74329e2eaee6027f19d678daa | |
parent | f225fafdf10f351d31e546b73eb511f46ffc6806 (diff) | |
download | dokka-8016c1face1283952e228aee348487bf0421ab90.tar.gz dokka-8016c1face1283952e228aee348487bf0421ab90.tar.bz2 dokka-8016c1face1283952e228aee348487bf0421ab90.zip |
Fix sources not being linked when using Maven (#3046)
-rw-r--r-- | docs/topics/runners/dokka-maven.md | 5 | ||||
-rw-r--r-- | runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/topics/runners/dokka-maven.md b/docs/topics/runners/dokka-maven.md index 14551c91..bc51d5fe 100644 --- a/docs/topics/runners/dokka-maven.md +++ b/docs/topics/runners/dokka-maven.md @@ -407,7 +407,7 @@ function in `kotlinx.coroutines`. <configuration> <sourceLinks> <link> - <path>${project.basedir}/src</path> + <path>src</path> <url>https://github.com/kotlin/dokka/tree/master/src</url> <lineSuffix>#L</lineSuffix> </link> @@ -422,6 +422,9 @@ function in `kotlinx.coroutines`. The path to the local source directory. The path must be relative to the root of the current module. </p> + <p> + Note: Only Unix based paths are allowed, Windows-style paths will throw an error. + </p> </def> <def title="url"> <p> diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index ba95e7a7..d14fea9c 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -389,7 +389,7 @@ public abstract class AbstractDokkaMojo( skipEmptyPackages = skipEmptyPackages, skipDeprecated = skipDeprecated, jdkVersion = jdkVersion, - sourceLinks = sourceLinks.map { SourceLinkDefinitionImpl(it.path, URL(it.url), it.lineSuffix) }.toSet(), + sourceLinks = sourceLinks.map { SourceLinkDefinitionImpl(File(it.path).canonicalPath, URL(it.url), it.lineSuffix) }.toSet(), perPackageOptions = perPackageOptions.map { @Suppress("DEPRECATION") // for includeNonPublic, preserve backwards compatibility PackageOptionsImpl( |