为所需的库键入Archive:项目'starter'中的spring-core-4.0.1.RELEASE.jar'无法读取或不是有效的ZIP文件

Pau*_*est 5 java eclipse spring m2e spring-boot

在Eclipse(STS 3.4)中导入由Spring Initializr生成的 Spring Starter 压缩项目时,我收到了错误

为所需的库键入Archive:项目'starter'中的'C:/Users/user/.m2/repository/org/springframework/spring-core/4.0.1.RELEASE/spring-core-4.0.1.RELEASE.jar'无法读取或不是有效的ZIP文件

是Eclipse问题还是有什么特别之处spring-core-4.0.1.RELEASE.jar?它的大小是979016B.

更新:尝试回答/sf/answers/1406547341/以消除maven错误:无法读取项目中所需库的存档或者不是有效的ZIP文件

跑步时 mvn package -U

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo: Compilation failure: Compilation failure:
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-context\4.0.1.RELEASE\spring-context-4.0.1.RELEASE.jar???; invalid LOC header (bad signature)
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-aop\4.0.1.RELEASE\spring-aop-4.0.1.RELEASE.jar???; invalid LOC header (bad signature)
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-beans\4.0.1.RELEASE\spring-beans-4.0.1.RELEASE.jar???; invalid CEN header (bad signature)
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-expression\4.0.1.RELEASE\spring-expression-4.0.1.RELEASE.jar???; invalid LOC header (bad signature)
[ERROR] ??C:\Users\weibl\.m2\repository\ch\qos\logback\logback-core\1.1.0\logback-core-1.1.0.jar???; invalid CEN header (bad signature)
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-context\4.0.1.RELEASE\spring-context-4.0.1.RELEASE.jar???; cannot read zip file entry
[ERROR] ??C:\Users\weibl\.m2\repository\org\springframework\spring-aop\4.0.1.RELEASE\spring-aop-4.0.1.RELEASE.jar???; cannot read zip file entry
[ERROR] /D:/Workspaces/workspace-sts-3.4.0.RELEASE/starter/src/main/java/demo/Application.java:[5,46] ???org.springframework.context.annotation???
[ERROR] /D:/Workspaces/workspace-sts-3.4.0.RELEASE/starter/src/main/java/demo/Application.java:[7,2] ?????
[ERROR] ??: ? ComponentScan
[ERROR] /D:/Workspaces/workspace-sts-3.4.0.RELEASE/starter/src/main/java/demo/Application.java:[12,30] ????org.springframework.context.ConfigurableApplicationContext
[ERROR] ???org.springframework.context.ConfigurableApplicationContext????
[ERROR] -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

invalid LOC header (bad signature) 但现在许多春天的罐子.

D:\Workspaces\workspace-sts-3.4.0.RELEASE\starter>mvn -version
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: D:\Progs\springsource\apache-maven-3.0.4\bin\..
Java version: 1.7.0_11, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_11\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
D:\Workspaces\workspace-sts-3.4.0.RELEASE\starter>
Run Code Online (Sandbox Code Playgroud)

Rob*_*ert 6

从本地存储库中删除相应的 .jar 文件并重新发出 maven 命令即可解决问题。下载时 .jar 文件似乎已损坏。