Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-778

Module not visible when creating test javadocs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.6.0
    • waiting-for-feedback
    • None
    • maven, java 17, windows 10

    Description

      I have an open source java project with java module system on github: https://github.com/PowerStat/Validation

      When doing a 

      mvn site

      This will result in the following:

       

       

          [INFO] Generating "Test Javadoc" report  --- maven-javadoc-plugin:3.6.0:test-aggregate-no-fork
          [INFO] Configuration changed, re-generating javadoc.
          [ERROR] Error while creating javadoc report:
          Exit code: 1
          C:\Users\PowerStat\Documents\Validation\src\test\java\de\powerstat\comparators\test\ComparatorEMailByDomainTests.java:7: error: package org.junit.jupiter.api is not visible
          import static org.junit.jupiter.api.Assertions.assertEquals;
                                         ^
            (package org.junit.jupiter.api is declared in the unnamed module, but module de.powerstat.validation does not read it)
          C:\Users\PowerStat\Documents\Validation\src\test\java\de\powerstat\comparators\test\ComparatorEMailByDomainTests.java:7: error: static import only from classes and interfaces
          import static org.junit.jupiter.api.Assertions.assertEquals;
          ^
          [...]
          100 errors
          Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-17\bin\javadoc.exe" @options @argfile"
          
          Refer to the generated Javadoc files in 'C:\Users\PowerStat\Documents\Validation\target\site\testapidocs' dir.
          
          org.apache.maven.reporting.MavenReportException:
          Exit code: 1
          C:\Users\PowerStat\Documents\Validation\src\test\java\de\powerstat\comparators\test\ComparatorEMailByDomainTests.java:7: error: package org.junit.jupiter.api is not visible
          import static org.junit.jupiter.api.Assertions.assertEquals;
                                         ^
            (package org.junit.jupiter.api is declared in the unnamed module, but module de.powerstat.validation does not read it)
          C:\Users\PowerStat\Documents\Validation\src\test\java\de\powerstat\comparators\test\ComparatorEMailByDomainTests.java:7: error: static import only from classes and interfaces
          import static org.junit.jupiter.api.Assertions.assertEquals;
          ^
          [...]
          100 errors
          Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-17\bin\javadoc.exe" @options @argfile"
          
          Refer to the generated Javadoc files in 'C:\Users\PowerStat\Documents\Validation\target\site\testapidocs' dir.
          at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.doExecuteJavadocCommandLine (AbstractJavadocMojo.java:5183)
          at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeJavadocCommandLine (AbstractJavadocMojo.java:5068)
          at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport (AbstractJavadocMojo.java:2028)
          at org.apache.maven.plugins.javadoc.TestJavadocReport.executeReport (TestJavadocReport.java:153)
          at org.apache.maven.plugins.javadoc.JavadocReport.generate (JavadocReport.java:135)
          at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:226)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:348)
          at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:194)
          at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:143)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:568)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
      

       

       

      I am assuming that the maven-javadoc-plugin is not using the 

      /src/test/java/module-info.test

        module descriptor, because this one contains 

      requires org.junit.jupiter.api;

      Which should solve the problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            powerstat Kai Hofmann
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: