maven 报错invalid LOC header(bad signature)

在命令行中执行mvn package的时候报错如下

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project bonus-notice-webapp: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\boot\spring-boot\1.4.2.RELEASE\spring-boot-1.4.2.RELEASE.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\boot\spring-boot-autoconfigure\1.4.2.RELEASE\spring-boot-autoconfigure-1.4.2.RELEASE.jar时出错; invalid CEN header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\spring-core\4.3.4.RELEASE\spring-core-4.3.4.RELEASE.jar时出错; invalid CEN header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\spring-context\4.3.4.RELEASE\spring-context-4.3.4.RELEASE.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.6\tomcat-embed-core-8.5.6.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\com\fasterxml\jackson\core\jackson-databind\2.8.4\jackson-databind-2.8.4.jar时出错; invalid CEN header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\spring-web\4.3.4.RELEASE\spring-web-4.3.4.RELEASE.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\spring-beans\4.3.4.RELEASE\spring-beans-4.3.4.RELEASE.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\springframework\spring-webmvc\4.3.4.RELEASE\spring-webmvc-4.3.4.RELEASE.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\com\alibaba\dubbo\2.8.5\dubbo-2.8.5.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\apache\zookeeper\zookeeper\3.4.8\zookeeper-3.4.8.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar时出错; invalid CEN header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\com\minshenglife\minshenglife-framework-commons\2.0.2\minshenglife-framework-commons-2.0.2.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar时出错; invalid LOC header (bad signature)
[ERROR] 错误: 读取D:\dev-tool\maven-repository\io\netty\netty-all\4.0.36.Final\netty-all-4.0.36.Final.jar时出错; invalid LOC header (bad signature)
[ERROR] [共 144 毫秒]
[ERROR] 15 个错误
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


解决办法
更改所用的IDE里面的maven的用户配置文件
如果用的是eclipse,则在preferences里面修改maven的settings.xml(增加私服仓库), 编译的时候,要用run as -- maven... -- 输入package运行, 这样就会编译成功


如果用的是Intellij IDEA, 也是在settings里面修改maven的配置文件settings.xml(增加私服仓库), 编译的时候,在"maven projects"里lifecycle选中“package”
,然后运行编译。 这样也会编译成功。
如果直接在命令行里,输入mvn package,则运行的maven配置是系统的maven统一配置,不是当前需要的那个settings.xml(比如C:\dev\mvn\apache-maven-3.3.1\conf\mslife\msSettings.xml)
因此会报上面的错误。


IntelliJ IDEA操作界面如下






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值