Have to ask again. Someone thought it was a duplicate question and already answered and removed it from the list.
I\'m using maven (mvn) batch command with windows (not
I faced the same issue on Windows. I had two Java installed. Oracle Java and OpenJDK and Maven was compiling with OpenJDK and it was giving this issue.
Since I wanted to continue compiling the source code using OpenJDK, to fix the issue, I specified the truststore path to Oracle JRE's cacerts library in the Maven command as follows.
mvn clean install -DskipTests -Djavax.net.ssl.trustStore=/path-to-oracle-java/jre/lib/security/cacerts