I ran this command in my project directory to build and package it:
mvn clean javadoc:jar package
I do have my JAVA_HOME varia
You can make it use the java.home system property instead of the JAVA_HOME environment variable:
org.apache.maven.plugins
maven-javadoc-plugin
3.0.1
${java.home}/bin/javadoc
Source of idea: https://medium.com/@kankvish/fixing-issue-the-environment-variable-java-home-is-not-correctly-set-b5f0b66a84d0