I am getting the below exception when I run my mvn install
. I have even deleted the local repository and ran again getting same exception.
<
I'd like to give my give my practice.
Use your preferred IDE, take eclipse for for example here:
Looks like problem of configuration for maven compiler in your pom file. Default version java source and target is 1.5, even used JDK has higher version.
To fix, add maven compiler plugin configuration section with higher java version, example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
For more info check these links:
maven compiler
bug report
You need to check which jar is giving problem. It must be corrupted. Delete that jar and run mvn spring-boot:run
command again. May be more that one jar has corrupted so every time you need to run that command to delete that jar. In my case mysql, jackson, aspect jars was corrupted mvn spring-boot:run
command 3 times and I figure out this and deleted the jars from .m2
folder. Now the issue has resolved.
This answer is not for DevOps/ system admin guys, but for them who are using IDE like eclipse and facing invalid LOC header (bad signature)
issue.
You can force update the maven dependencies, as follows:
We can force the checksum validation in maven with at least two options:
1.Adding the --strict-checksums
to our maven command.
2.Adding the following configuration to our maven settings file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--...-->
<profiles>
<profile>
<!--...-->
<repositories>
<repository>
<id>codehausSnapshots</id>
<name>Codehaus Snapshots</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>
<!--...-->
</url>
</repository>
</repositories>
<pluginRepositories>
<!--...-->
</pluginRepositories>
<!--...-->
</profile>
</profiles>
<!--...-->
</settings>
More details in this post: https://dzone.com/articles/maven-artifact-checksums-what
The jar file may be corrupt. Try removing the content of the following folder:
C:\Users\[username]\.m2\repository
Then right click your project, select Maven, Update Project, check on Force Update of Snapshots/Releases.