0

When running the package phase in maven, I get the following warning after the javadoc has been generated:

javadoc: warning - The code being documented uses modules but the packages defined in http://docs.oracle.com/javase/7/docs/api/ are in the unnamed module. 

What does this mean?

  • It looks like your project uses java 7 but you are running it using some higher java versions which apparently might cause some problems. Please see the: https://stackoverflow.com/questions/62531431/exit-code-1-javadoc-error-the-code-being-documented-uses-modules-but – Piotr Michalczyk Oct 19 '21 at 19:03

1 Answers1

0

Something similar happened to me. I got the following error message when employing the maven-javadoc-plugin.

[ERROR] javadoc: warning - The code being documented uses modules but the packages defined in http://docs.oracle.com/javase/7/docs/api/ are in the unnamed module.

I had copied and pasted example xml into my POM verbatim which employed version 2.9.1. When I updated to the current version (currently 3.4.0) this error went away.

IDK if you are using this plugin. If so, check the version. If not, perhaps you can troubleshoot your plugins to determine which, if any, are triggering this error message. If there is a specific culprit, check that it is a current version.

My project is set to compile at a compatibility level for Java 11. I don't have any references to Java 1.7, AFAIK. I've run across various situations using Maven where older versions of Java are the default, so I think in any configuration situation that allows you specify a Java version, it's maybe safest to simply go ahead and do so, even if it is optional.

Phil Freihofner
  • 7,645
  • 1
  • 20
  • 41