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:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
</plugin>
Source of idea: https://medium.com/@kankvish/fixing-issue-the-environment-variable-java-home-is-not-correctly-set-b5f0b66a84d0