ScaCap / spring-auto-restdocs

Spring Auto REST Docs is an extension to Spring REST Docs
https://scacap.github.io/spring-auto-restdocs/
Apache License 2.0
311 stars 86 forks source link

NoClassDefFoundError when running with 3.5.0 maven-doc-plugin #472

Closed arolfes closed 10 months ago

arolfes commented 1 year ago

Hello ScaCap Team,

I want to upgrade the maven-doc-plugin to version 3.5.0

This is my config

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <extensions>true</extensions>
        <configuration>
          <tags>
            <tag>
              <name>title</name>
              <placement>m</placement>
            </tag>
          </tags>
        </configuration>
        <executions>
          <execution>
            <id>generate-javadoc-json</id>
            <phase>validate</phase>
            <goals>
              <goal>javadoc-no-fork</goal>
            </goals>
            <configuration>
              <doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
              <docletArtifact>
                <groupId>capital.scalable</groupId>
                <artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
                <version>2.0.11</version>
              </docletArtifact>
              <destDir>generated-javadoc-json</destDir>
              <reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
              <useStandardDocletOptions>false</useStandardDocletOptions>
              <show>package</show>
            </configuration>
          </execution>
        </executions>
      </plugin>

and this is the error I receive

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.5.0:javadoc-no-fork (generate-javadoc-json) on project taskana-rest-spring: An error has occurred in Javadoc report generation: 
[ERROR] Exit code: 4
[ERROR] error: fatal error encountered: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
[ERROR] error: Please file a bug against the javadoc tool via the Java bug reporting page
[ERROR]   (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com)
[ERROR]   for duplicates. Include error messages and the following diagnostic in your report. Thank you.
[ERROR] java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
[ERROR]         at capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet.createObjectMapper(ExtractDocumentationAsJsonDoclet.java:160)
[ERROR]         at capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet.run(ExtractDocumentationAsJsonDoclet.java:58)
[ERROR]         at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:556)
[ERROR]         at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:393)
[ERROR]         at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:342)
[ERROR]         at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
[ERROR]         at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
[ERROR] Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ObjectMapper
[ERROR]         at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[ERROR]         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[ERROR]         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[ERROR]         ... 7 more