5

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

我已经尝试重新运行 Maven > Clean, Maven Install 几次(因为有时它会以这种方式工作)但没有用。我仍然收到相同的错误消息。

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

[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)
4

3 回答 3

3

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

于 2013-10-21T09:48:15.543 回答
2

您是否还移动了 Maven 存储库的位置?

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

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

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

于 2013-10-16T11:58:25.193 回答
1

只需创建 .m2 文件夹并运行全新安装命令。

于 2013-10-16T11:44:44.890 回答