I try to run maven install on my project with some dependencies:
log4j
log4j
step1.
Clean your .m2\repository
or delete your specific folders from the .m2\repository
directory
step2.
run mvn clean install
step3.
be sure that your internet connection is working fine at the time of running this command, some times it fails due to connection problems.
It seems to be due to an incorrect connection url in your maven plugin. I was using a vpn connection earlier and hence, it had initialized it with that url which was not valid anymore.
rm -rf {PATH to .m2}/repository/org/apache/maven/plugins/
This should fix it
I was facing the same issue just now. Changing maven compiler plugin version to 3.1 helped.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
In my case It was giving below error
error: error reading C:\Users\ppatel4.m2\repository\org\apache\xalan\xalan\2.7. 1\xalan-2.7.1.jar; error in opening zip file
Below are the steps I did to fix it.
$ cp xalan-2.7.1.jar ~/.m2/repository/org/apache/xalan/xalan/2.7.1/
Its Done… Try to execute your mvn clean install command.