Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring error during build

Tags:

I have to make small website using spring. so i chose spring template project then new spring mvc project whatever i try there is an error that occurred

Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'mTime'.Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'mTime'. Could not calculate build plan: Failed to parse plugin descriptor for org.apache.maven.plugins:maven-war-plugin:2.1.1 (C:\Users\User01\.m2\repository\org\apache\maven\plugins\maven-war-plugin\2.1.1\maven-war-plugin-2.1.1.jar): invalid LOC header (bad signature) Failed to parse plugin descriptor for org.apache.maven.plugins:maven-war-plugin:2.1.1 (C:\Users\User01\.m2\repository\org\apache\maven\plugins\maven-war-plugin\2.1.1\maven-war-plugin-2.1.1.jar): invalid LOC header (bad signature) Could not calculate build plan: Failed to parse plugin descriptor for org.apache.maven.plugins:maven-war-plugin:2.1.1 (C:\Users\User01\.m2\repository\org\apache\maven\plugins\maven-war-plugin\2.1.1\maven-war-plugin-2.1.1.jar): invalid LOC header (bad signature) Failed to parse plugin descriptor for org.apache.maven.plugins:maven-war-plugin:2.1.1 (C:\Users\User01\.m2\repository\org\apache\maven\plugins\maven-war-plugin\2.1.1\maven-war-plugin-2.1.1.jar): invalid LOC header (bad signature) 

i know that maven is included in spring framework, and when i check the directory, the jars are there.

How can I solve this error?

like image 395
Swift Sharp Avatar asked Oct 24 '12 07:10

Swift Sharp


2 Answers

The relevant part of the error message is:

invalid LOC header (bad signature) 

which suggests some binary file being broken, most likely one of the dependencies. If you have a fast Internet connection, just delete your whole maven repository and let maven redownload all the dependencies:

rm -rf ~/.m2/repository/* 

See also

  • some error while running spring mvc project
  • Maven:: Invalid CEN (bad signature) Invalid LOC (bad signature)
like image 64
Tomasz Nurkiewicz Avatar answered Oct 30 '22 20:10

Tomasz Nurkiewicz


From my experience , invalid LOC header (bad signature) is most probably due to the downloaded .jar file is corrupt.

If you have a slow internet connection , instead of deleting the whole Maven repository , you can try to delete the folder containing the problematic jar according to the hints of the errors message (i.e C:\Users\User01\.m2\repository\org\apache\maven\plugins\maven-war-plugin\2.1.1\) . Then use mvn clean install -U to download the dependencies again.

like image 44
Ken Chan Avatar answered Oct 30 '22 19:10

Ken Chan