Skip to content

maven-javadoc-plugin fails due to Automatic-Module-Name #5136

Closed

Description

@joschi

3.0.0-beta.1: https://github.com/dropwizard/dropwizard/runs/5875633807?check_suite_focus=true#step%3A4%3A3444=

Error:  Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.2:jar (attach-javadocs) on project dropwizard-jersey: MavenReportException: Error while generating Javadoc: 
Error:  Exit code: 1 - /home/runner/work/dropwizard/dropwizard/dropwizard-jersey/src/main/java/io/dropwizard/jersey/DropwizardResourceConfig.java:29: error: cannot find symbol
Error:  import javax.annotation.Nullable;

4.0.0-beta.1: https://github.com/dropwizard/dropwizard/runs/5875544966?check_suite_focus=true#step:4:10598

Error:  Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.2:jar (attach-javadocs) on project dropwizard-testing: MavenReportException: Error while generating Javadoc: 
Error:  Exit code: 1 - /home/runner/work/dropwizard/dropwizard/dropwizard-testing/src/main/java/io/dropwizard/testing/common/DropwizardTestResourceConfig.java:22: error: cannot access ResourceConfig
Error:  class DropwizardTestResourceConfig extends DropwizardResourceConfig {
Error:  ^
Error:    class file for org.glassfish.jersey.server.ResourceConfig not found
Error:  /home/runner/work/dropwizard/dropwizard/dropwizard-testing/src/main/java/io/dropwizard/testing/junit5/DropwizardExtensionsSupport.java:8: error: package org.junit.platform.commons.util is not visible
Error:  import org.junit.platform.commons.util.ReflectionUtils;
Error:                                   ^
Error:    (package org.junit.platform.commons.util is declared in module org.junit.platform.commons, which does not export it to module io.dropwizard.testing)
Error:  
Error:  Command line was: /usr/lib/jvm/temurin-11-jdk-amd64/bin/javadoc @options @packages

🔗 https://issues.apache.org/jira/projects/MJAVADOC/issues/MJAVADOC-707

Activity

  1. added this to the 3.0.0 milestone on Apr 7, 2022
  2. joschi commented on Apr 8, 2022

    @joschi
    MemberAuthor
    Error:  Exit code: 1 - /home/runner/work/dropwizard/dropwizard/dropwizard-jersey/src/main/java/io/dropwizard/jersey/DropwizardResourceConfig.java:29: error: cannot find symbol
    Error:  import javax.annotation.Nullable;
    

    https://nipafx.dev/jsr-305-java-9/

  3. zUniQueX commented on Apr 8, 2022

    @zUniQueX
    Member

    Should we then migrate from JSR-305 to an other nullness checking library? If so, we could think of checker-qual as a replacement since we already have a dependency on it.

  4. zUniQueX commented on Apr 18, 2022

    @zUniQueX
    Member

    Since #5176 is merged, should we re-introduce the module names?

  5. joschi commented on Apr 18, 2022

    @joschi
    MemberAuthor

    @zUniQueX Unfortunately it's still failing at another location now:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.2:jar (attach-javadocs) on project dropwizard-request-logging: MavenReportException: Error while generating Javadoc:
    [ERROR] Exit code: 1 - javadoc: error - An internal exception has occurred.
    [ERROR] 	(com.sun.tools.javac.code.Symbol$CompletionFailure: class file for ch.qos.logback.core.AsyncAppenderBase not found)
    [ERROR] Please file a bug against the javadoc tool via the Java bug reporting page
    [ERROR] (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
    [ERROR] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
    [ERROR] com.sun.tools.javac.code.Symbol$CompletionFailure: class file for ch.qos.logback.core.AsyncAppenderBase not found
    [ERROR]
    [ERROR] Command line was: $HOME/.asdf/installs/java/temurin-11.0.13+8/bin/javadoc @options @packages
    [ERROR]
    [ERROR] Refer to the generated Javadoc files in '$HOME/src/dropwizard/dropwizard-request-logging/target/apidocs' dir.
    
  6. zUniQueX commented on May 5, 2022

    @zUniQueX
    Member

    @joschi I've now further investigated this and this error is really strange. dropwizard-logging also uses the AsyncAppenderBase and there is no error in the JavaDoc generation.

    When manually overriding the version of logback-core to 1.3.0-alpha0 and excluding it from all other places, the build of dropwizard-request-logging still works and the JavaDoc-JAR gets generated without an error.

    However, when comparing the tags in the logback repo in GitHub, the only changes in AsyncAppenderBase are changes in the JavaDoc of this file itself, which shouldn't cause our problem in my opinion.

  7. zUniQueX commented on May 10, 2022

    @zUniQueX
    Member

    To not override the logback-core dependency to an other version, we could introduce the following javadoc configuration as a workaround:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <additionalDependencies>
                        <additionalDependency>
                            <groupId>ch.qos.logback</groupId>
                            <artifactId>logback-core</artifactId>
                            <version>1.3.0-alpha0</version>
                        </additionalDependency>
                    </additionalDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

    I couldn't find a reason why this should be necessary but I don't see an other solution for now. Seems like logback is working on support for Jetty 10 on the 1.3.x branch, so this workaround should be only temporary then.

  8. zUniQueX commented on Sep 2, 2022

    @zUniQueX
    Member

    The error in dropwizard-request-logging is fixed, since the 3.0.x branch now uses Logback 1.3.0, which introduced modules.

    However, Jersey is still an issue in dropwizard-testing. The error with the ReflectionUtils class can be fixed easily, but the ResourceConfig class cannot be resolved by the maven-javadoc-plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions