17

I have a small project with the following structure:

pom.xml

src/main/java/
  module-info.java
  de.ps.pl.te/
    package-info.java
    TE.java

src/test/java/
   de.ps.pl.te.test/
     package-info.java
     TETests.java

Also within my maven pom I defined the javadoc plugin as follows:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <show>protected</show>
          <failOnError>false</failOnError>
        </configuration>
      </plugin>

Now I got some strange outputs during running

mvn clean install site

[INFO] Generating "Javadoc" report --- maven-javadoc-plugin:3.1.0:aggregate-no-fork [ERROR] Error fetching link: D:\work\eclipse\java\FritzBox\phplib\target\javadoc-bundle-options. Ignored it.

[...]

[INFO] Generating "Test Javadoc" report --- maven-javadoc-plugin:3.1.0:test-aggregate-no-fork

[ERROR] Error fetching link: D:\work\eclipse\java\FritzBox\phplib\target\javadoc-bundle-options. Ignored it.

Loading source files for package de.ps.pl.te.test...

1 error

[ERROR] Error while creating javadoc report:

Exit code: 2 - javadoc: error - No source files for package de.powerstat.phplib.templateengine.test

Command line was: [...]javadoc.exe @options @packages

Refer to the generated Javadoc files in '[...]' dir.

org.apache.maven.reporting.MavenReportException:

Exit code: 2 - javadoc: error - No source files for package de.ps.pl.te.test

Command line was: [...]javadoc.exe @options @packages

Refer to the generated Javadoc files in '[...]\target\site\testapidocs' dir.

at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeJavadocCommandLine (AbstractJavadocMojo.java:5761)

at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport (AbstractJavadocMojo.java:2148)

at org.apache.maven.plugins.javadoc.TestJavadocReport.executeReport (TestJavadocReport.java:162)

[...]

I studied the following question:

But my problem seems to be different and based on java modularisation. So the question is how to fix it - or is it more to make a bug report?

EDIT 1

Now I tried with JDK 11.0.3 and JDK 12.0.1 - I was unable to download OpenJDK because of oracle certificate and server problems - so I could not test OpenJDK 13 early access.

The interesting point is that the error message differs slighly when using version 11/12.

With JDK 11 the error is:

Exit code: 1 - Project\src\main\java\module-info.java:12: error: module not found: org.apache.logging.log4j requires org.apache.logging.log4j;

With JDK 12 the error is:

Exit code: 1 - error: module not found: de.powerstat.phplib.templateengine

The rest of the message is still the same.

Also I found a bug report that might be involved here:

Javadoc does not support module-info in a multi-release jar

Also I tried to exclude the module-info.java without success:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.1.0</version>
  <configuration>
    <show>protected</show>
    <failOnError>false</failOnError>
    <sourceFileExcludes>
      <sourceFileExclude>**/module-info.java</sourceFileExclude>
    </sourceFileExcludes>
  </configuration>
</plugin>

EDIT 2

Within target\site\apidocs I could finde the following (maven generated?) files:

  • argfile
  • javadoc.bat
  • options
  • packages

argfile:

'D:/TemplateEngine/src/main/java/de/ps/pl/te/package-info.java'
'D:/TemplateEngine/src/main/java/de/ps/pl/te/TemplateEngine.java'

javadoc.bat:

D:\Programme\Java\jdk-11.0.3\bin\javadoc.exe @options @argfile

packages:

de.powerstat.phplib.templateengine
de.powerstat.phplib.templateengine

options:

--module-path
'C:/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar;C:/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar'
-sourcepath
'D:/TemplateEngine/src/main/java'
-d
'D:/TemplateEngine/target/site/apidocs'
-linkoffline
'https://docs.oracle.com/en/java/javase/11/docs/api' 'D:/TemplateEngine/target/javadoc-bundle-options'
[Removed uninteresting parts like encoding, title etc.]

For the case that someone would like to try it him-/herself I have made the whole project now available at GitHub

EDIT 3:

Some of the above mentioned problems have been vanished with updating to Java 11.0.10 or other newer versions. But still one problem is around - which I have reported as a bug.

13
  • 2
    So you didn't put TETests in the same package as TE? Any, both should work, but I guess all combinations with module descriptos aren't covered yet. I'd suggest to create an issue for it at issues.apache.org/jira/browse/MJAVADOC together with this small project as zip. Apr 19, 2019 at 20:07
  • Did you try with java 11 or java 13? I don't reproduce it with theses version. also maybe provide the full pom and the package-info. Also if you don't use module-info your application is not modularized.
    – pdem
    Apr 23, 2019 at 15:03
  • What Maven version are you using? Apr 26, 2019 at 23:01
  • 4
    It might be better to you provide a minimal example project on some public git repo
    – Marinos An
    Apr 30, 2019 at 10:51
  • 1
    @Marinos An I made my project now available on github - see EDIT 2
    – PowerStat
    Jun 18, 2019 at 18:57

2 Answers 2

1

While testing I seen this error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site (default-site) on project templateengine: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.7.1:site failed: could not find reports directory [C:\tmp\TemplateEngine\target\pit-reports]
[ERROR]
[ERROR] Please copy and paste the information and the complete stacktrace below when reporting an issue
[ERROR] VM : OpenJDK 64-Bit Server VM
[ERROR] Vendor : Oracle Corporation
[ERROR] Version : 12.0.1+12
[ERROR] Uptime : 146619
[ERROR] Input ->
[ERROR]  1 : -Dclassworlds.conf=C:/ProgramData/chocolatey/lib/maven/apache-maven-3.6.1/bin/m2.conf
[ERROR]  2 : -Dmaven.home=C:/ProgramData/chocolatey/lib/maven/apache-maven-3.6.1
[ERROR]  3 : -Dlibrary.jansi.path=C:/ProgramData/chocolatey/lib/maven/apache-maven-3.6.1/lib/jansi-native
[ERROR]  4 : -Dmaven.multiModuleProjectDirectory=C:/tmp/TemplateEngine
[ERROR] BootClassPathSupported : false

just created the folder "mkdir ./target/pit-reports" and it went away. this is generating the problem

<show>private</show>

So we can say you found a bug in maven-javadoc-plugin :)

2
  • Good to know - do I have to report it, or do you already have reported it?
    – PowerStat
    Jun 30, 2019 at 20:13
  • I just found a work around. You found it you should report it. Jul 2, 2019 at 5:27
1

I recently ran into the same error. Looked like it was because of maven-shade-plugin in my repo. I was using an older version of 1.6 and upgraded it to 3.2.4 and this error was gone.

1
  • This should be a comment on the question, not an answer. Down voting.
    – axiopisty
    Oct 27, 2020 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.