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.