java – 所需库的类型存档:项目’starter’中的spring-core-4.0.1.RELEASE.jar’无法读取或不是有效的ZIP文件

Eclipse(STS 3.4)中导入Spring Starter zipped project generated by Spring Initializr时出错

Type Archive for required library: ‘C:/Users/user/.m2/repository/org/springframework/spring-core/4.0.1.RELEASE/spring-core-4.0.1.RELEASE.jar’ in project ‘starter’ cannot be read or is not a valid ZIP file

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

更新:尝试回答https://stackoverflow.com/a/20093533/482717eclipse maven error: Archive for required library in project cannot be read or is not a valid ZIP file

运行mvn包-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]

无效的LOC标题(错误的签名),但现在许多春天的罐子.

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>
最佳答案
从本地存储库中删除相应的.jar文件并重新发出maven命令就可以了.下载时,.jar文件似乎已损坏.

相关文章

Spring Cloud为Spring Boot应用程序提供Netflix OSS集成。 提供的功能模块包括服务发现(Eureka),断路...
Spring Cloud 学习笔记;maven配置;入门学习;基于Spring Boot 实现;服务端配置,客户端配置;
可以毫不夸张地说,这篇文章介绍的 Spring/SpringBoot 常用注解基本已经涵盖你工作中遇到的大部分常用的...
Spring中各种方式进行日期时间处理,有作用于单个实体的,也有作用于全局的,有作用于请求入参的,有作...
跨域资源共享(Cross-origin resource sharing)(CORS)是W3C的标准,大部分的浏览器都实现了这个标准...
Spring Boot使创建基于Spring的应用程序变得轻松,大部分的SpringBoot应用程序都只需要很少的Spring配置...