Skip to content

[Bug] Dokka 2.x Fails to Build When dependencyManagement Contains Versionless Artifact Entry #4527

@bca111

Description

@bca111

What is happening? What should have happened instead?

Dokka 2.x fails with The version cannot be empty when a Maven dependencyManagement section contains an artifact entry without an explicit version, where the version is expected to be provided by an imported BOM (e.g. Spring Boot BOM). Maven resolves this correctly, but Dokka plugin does not.

Reproducer

Steps to Reproduce

  1. Import a BOM in dependencyManagement that manages jackson-module-jaxb-annotations:
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-dependencies</artifactId>
      <version>3.5.14</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
  1. Declare the same artifact in dependencyManagement without a version (relying on the BOM to provide it), but with an exclusion:
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-jaxb-annotations</artifactId>
      <!-- No version — expected to be provided by Spring Boot BOM -->
      <exclusions>
        <exclusion>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
</dependencyManagement>
  1. Run Dokka:

mvn dokka:dokka

Builds fails with

[ERROR] Failed to execute goal org.jetbrains.dokka:dokka-maven-plugin:2.2.0:dokka 
(default) on project ....: Execution default of goal 
org.jetbrains.dokka:dokka-maven-plugin:2.2.0:dokka failed: For artifact 
{com.fasterxml.jackson.module:jackson-module-jaxb-annotations:null:jar}: 
The version cannot be empty. -> [Help 1]

Dokka version

2.2.0

Kotlin Gradle Plugin (KGP) version

No response

Android Gradle Plugin (AGP) version (if applicable)

No response

Build tool

Maven

Project type

  • Kotlin Multiplatform (KMP)
  • Android
  • JVM
  • Other

Anything else? (optional)

This was working fine on 1.9 but breaks on both 2.1 and 2.2.

Currently have a workaround by adding following in pom (dependency with exclusion is on parent pom):

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-jaxb-annotations</artifactId>
      <version>2.21.2</version>
    </dependency>
  </dependencies>
</dependencyManagement>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions