删除.m2文件夹后Maven安装错误

时间:2013-10-16 11:42:14

标签: java maven

我被指示删除.m2文件夹,因为我遇到了一个项目依赖项问题,但现在我尝试使用Maven>清洁,然后Maven>安装应用程序我收到以下错误。

我尝试过重新运行Maven>清洁,Maven安装几次(因为有时它以这种方式工作)但没有用。我仍然得到相同的错误消息。

有人可以建议我如何解决这个问题吗?

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Inventory 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ crm ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ crm ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 73 source files to E:\springsource\workspace\Inventory\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-context-support\3.1.0.RELEASE\spring-context-support-3.1.0.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\aspectj\aspectjrt\1.6.9\aspectjrt-1.6.9.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\slf4j\slf4j-api\1.5.10\slf4j-api-1.5.10.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar; invalid CEN header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-tx\3.0.7.RELEASE\spring-tx-3.0.7.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\security\spring-security-config\3.1.3.RELEASE\spring-security-config-3.1.3.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\hibernate\hibernate-entitymanager\3.6.0.Final\hibernate-entitymanager-3.6.0.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar; Unexpected end of ZLIB input stream
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\hibernate\hibernate-commons-annotations\3.2.0.Final\hibernate-commons-annotations-3.2.0.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\transaction\jta\1.1\jta-1.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-orm\3.1.0.RELEASE\spring-orm-3.1.0.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-plugin-registry\2.0.6\maven-plugin-registry-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-error-diagnostics\2.0.6\maven-error-diagnostics-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\commons-cli\commons-cli\1.0\commons-cli-1.0.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-artifact\2.0.6\maven-artifact-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-model\2.0.6\maven-model-2.0.6.jar; invalid LOC header (bad signature)
[INFO] 18 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.074s
[INFO] Finished at: Wed Oct 16 13:36:32 EET 2013
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project crm: Compilation failure: Compilation failure:
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-context-support\3.1.0.RELEASE\spring-context-support-3.1.0.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\aspectj\aspectjrt\1.6.9\aspectjrt-1.6.9.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\slf4j\slf4j-api\1.5.10\slf4j-api-1.5.10.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar; invalid CEN header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-tx\3.0.7.RELEASE\spring-tx-3.0.7.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\security\spring-security-config\3.1.3.RELEASE\spring-security-config-3.1.3.RELEASE.jar; invalid CEN header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\hibernate\hibernate-entitymanager\3.6.0.Final\hibernate-entitymanager-3.6.0.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar; Unexpected end of ZLIB input stream
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\hibernate\hibernate-commons-annotations\3.2.0.Final\hibernate-commons-annotations-3.2.0.Final.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\javax\transaction\jta\1.1\jta-1.1.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\springframework\spring-orm\3.1.0.RELEASE\spring-orm-3.1.0.RELEASE.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-plugin-registry\2.0.6\maven-plugin-registry-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-error-diagnostics\2.0.6\maven-error-diagnostics-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\commons-cli\commons-cli\1.0\commons-cli-1.0.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-artifact\2.0.6\maven-artifact-2.0.6.jar; invalid LOC header (bad signature)
[ERROR] error: error reading C:\Documents and Settings\vmuser\.m2\repository\org\apache\maven\maven-model\2.0.6\maven-model-2.0.6.jar; invalid LOC header (bad signature)

3 个答案:

答案 0 :(得分:2)

整个问题在于我右键单击项目文件夹,选择Maven>清洁,然后Maven>安装。当我右键单击pom.xml并选择Maven>安装一切正常。

答案 1 :(得分:1)

只需创建.m2文件夹并运行clean install命令。

答案 2 :(得分:1)

您是否也移动了maven存储库的位置?

某些maven版本在路径名中有空格有些问题。因此,您可以尝试更改settings.xml中的位置 - 然后mvn clean install应重新下载所有内容。

也许其中一些工件被重新下载但是已损坏?然后我会再次删除它们并重试。也许罐子是来自代理的HTML文件?

您还可以执行mvn dependency:go-offline - 这也将下载插件以及构建项目所需的所有其他内容。