maven install throw“在打开zip文件时出错”只有在第二次尝试之后 [英] maven install throw "error in opening zip file" only after the second try

查看:183
本文介绍了maven install throw“在打开zip文件时出错”只有在第二次尝试之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 <依赖关系>我试图在我的项目上运行maven install。 
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.15< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.5.2< / version>
< /依赖关系>
< dependency>
< groupId> ch.qos.logback< / groupId>
< artifactId> logback-classic< / artifactId>
< version> 0.9.24< / version>
< /依赖关系>

< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 3.3.2.GA< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-annotations< / artifactId>
< version> 3.4.0.GA< / version>
< /依赖关系>

第一次运行 mvn install 运行得很好(BUILD SUCCESS)
但是第二次(在我对代码进行了一些修改之后)我尝试运行 mvn install ,并且使用maven throw打开zip文件时出错。

  [错误]错误:读取错误C:\ Users \Idan\.m2 \repository\javax\jms\jms\1.1\jms- 1.1.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\com\sun\jdmk\jmxtools\1.2.1\ jmxtools-1.2.1.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\com\sun\jmx\jmxri\1.2.1\ jmxri-1.2.1.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24 \logback-经典0.9.24.jar;打开zip文件时出错

但是

如果我删除
log4j,
slf4j,
和logback-classoc
依赖项
运行maven install(BUILD SUCCESS)
返回
log4j,
slf4j,
和logback-classic
依赖关系
运行maven安装它就可以运行(BUILD SUCCESS)。



可能是什么问题?

更新:

< >删除所有.m2 / reposetory文件夹删除我的项目中的所有目标文件夹
然后运行 mvn install 并且我得到

  [INFO]扫描项目... 
[信息]
[信息] --------- -------------------------------------------------- -------------
[INFO] Building d 0.0.1-SNAPSHOT
[INFO] ---------------- -------------------------------------------------- ------
SLF4J:未能加载类org.slf4j.impl.Stat icLoggerBinder。
SLF4J:默认为无操作(NOP)记录器实现
SLF4J:有关详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder。
正在下载:http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom
下载:http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom(10 KB在28.9 KB /秒)
下载:http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire/2.7.1/surefire-2.7.1.pom
下载:http: //repo1.maven.org/maven2/org/apache/maven/surefire/surefire/2.7.1/surefire-2.7.1.pom(10 KB在40.7 KB /秒)
下载:http:// repo1.maven.org/maven2/org/apache/maven/maven-parent/18/maven-parent-18.pom
下载:http://repo1.maven.org/maven2/org/apache/maven /maven-parent/18/maven-parent-18.pom(24 KB在74.0 KB /秒)
下载:http://repo1.maven.org/maven2/org/apache/apache/8/apache -8.pom
下载:http://repo1.maven.org/maven2/org/apache/apache/8/apache-8.pom(14 KB,文件大小为43.3 KB / sec)
下载: http://repo1.maven.org/maven2/org/apache/maven/p lugins / maven-surefire-plugin / 2.7.1 / maven-surefire-plugin-2.7.1.jar
下载:http://repo1.maven.org/maven2/org/apache/maven/plugins/maven -surefire-plugin / 2.7.1 / maven-surefire-plugin-2.7.1.jar(29 KB,50.1 KB /秒)
下载:http://repo1.maven.org/maven2/org/apache /maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
下载:http://repo1.maven.org/maven2/org/apache/maven/插件/ maven-install-plugin / 2.3.1 / maven-install-plugin-2.3.1.pom(5 KB at 21.0 KB / sec)
下载:http://repo1.maven.org/maven2/ org / apache / maven / plugins / maven-install-plugin / 2.3.1 / maven-install-plugin-2.3.1.jar
下载地址:http://repo1.maven.org/maven2/org/apache /maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.jar(23 KB在40.8 KB /秒)
[警告] POM for log4j:log4j:jar :1.2.15是无效的,传递依赖关系(如果有的话)将不可用,请启用调试日志记录以获取更多详细信息
[WARNING] org.slf4j的POM:slf4j-log4j12:jar: 1.5.2无效,传递依赖关系(如果有的话)将不可用,请启用调试日志记录以获取更多详细信息
[WARNING] ch.qos.logback的POM:logback-classic:jar:0.9.24无效,传递依赖(如果有的话)将不可用,为更多细节启用调试日志记录
[WARNING] org.hibernate的POM:hibernate-core:jar:3.3.2.GA无效,传递依赖(if任何)将不可用,为更多细节启用调试日志记录
[WARNING] org.hibernate的POM:hibernate-annotations:jar:3.4.0.GA无效,传递依赖关系(如果有的话)不会可用,启用调试日志记录以获取更多详细信息
[WARNING] org.hibernate的POM:hibernate-commons-annotations:jar:3.3.0.ga是无效的,传递依赖关系(如果有的话)将不可用,启用调试日志以获取更多详细信息
[WARNING] org.hibernate的POM:hibernate-entitymanager:jar:3.4.0.GA无效,传递依赖关系(如果有的话)将不可用,启用调试日志记录有关更多详细信息,请参阅
[警告] junit:junit:jar:3.8.1的POM无效,传递依赖关系(如果有)将不可用,请启用调试日志记录以获取更多详细信息。
[警告] POM for postgresql:postgresql:jar:9.1-901.jdbc4是无效的,传递依赖关系(如果有的话)将不可用,启用调试日志记录以获取更多详细信息
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources(default-resources)@ d ---
[INFO]使用'UTF-8'编码来复制已过滤的资源。
[INFO]复制4个资源
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile(default-compile)@ d ---
正在下载:http://repo1.maven.org/maven2/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom
下载:http://repo1.maven.org /maven2/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom(4 KB以7.6 KB /秒)
下载:http://repo1.maven.org/maven2/org /codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.pom
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/ plexus-compiler-api / 1.8.1 / plexus-compiler-api-1.8.1.pom(805 B,速度为3.4 KB /秒)
下载:http://repo1.maven.org/maven2/org/ codehaus / plexus / plexus-compiler / 1.8.1 / plexus-compiler-1.8.1.pom
已下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler/1.8 .1 / plexus-compiler-1.8.1.pom(4 KB,11.9 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-components/1.1 0.18 /丛组件-1.1.18 .pom
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom(6 KB at 20.7 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom
下载:http:// repo1 .maven.org / maven2 / org / codehaus / plexus / plexus / 2.0.7 / plexus-2.0.7.pom(17 KB at 57.6 KB / sec)
下载:http://repo1.maven.org /maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/ plexus-utils / 1.5.5 / plexus-utils-1.5.5.pom(6 KB,10.4 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/ plexus-compiler-manager / 1.8.1 / plexus-compiler-manager-1.8.1.pom
已下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager /1.8.1/plexus-compiler-manager-1.8.1.pom(713 B,3.0 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus -compiler-的javac / 1.8.1 /丛,组合物1 ler-javac-1.8.1.pom
已下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8 .1.pom(710 B,3.0 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compilers/1.8.1/plexus-compilers-1.8 .1.pom
已下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compilers/1.8.1/plexus-compilers-1.8.1.pom(2 KB at 3.9 KB /秒)
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar
下载:http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.jar
下载: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar
下载:http:// repo1 .maven.org / maven2 / org / codehaus / plexus / plexus-compiler-api / 1.8.1 / plexus-compiler-api-1.8.1.jar(20 KB,39.4 KB / sec)
下载:http ://repo1.maven.org/maven 2 / org / codehaus / plexus / plexus-compiler-manager / 1.8.1 / plexus-compiler-manager-1.8.1.jar(6 KB,速度为10.8 KB /秒)
下载:http:// repo1。 maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar(13 KB,12.3 KB /秒)
[INFO]编译4源文件到D:\projectsWorkspace\connectingtopostgresdbtests\d\target\classes
[INFO] ---------------------- ---------------------------------------
[错误]编译错误:
[信息] -------------------------------------------- -----------------
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\log4j\log4j\\ \\1.2.15\log4j-1.2.15.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\\\\\\\\\\\\\\\\\\\\\\\\\\ -log4j12-1.5.2.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24 \logback-经典0.9.24.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-core\3.3.2.GA\\ \\hibernate芯-3.3.2.GA.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-annotations\3.4.0.GA\\ \\hibernate-注解-3.4.0.GA.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0。 ga\hibernate-公地注解-3.3.0.ga.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-entitymanager\3.4.0.GA\\ \\hibernate-的EntityManager-3.4.0.GA.jar;打开zip文件时出错
[ERROR]错误:读取错误C:\ Users \Idan\.m2\repository\postgresql\postgresql\9.1-901.jdbc4\postgresql-9.1- 901.jdbc4.jar;打开zip文件时出错
[INFO] 8错误
[INFO] ----------------------------- --------------------------------
[INFO] ----------- -------------------------------------------------- -----------
[INFO] BUILD FAILURE
[INFO] ----------------------- -------------------------------------------------
[信息]总时间:11.573s
[信息]完成时间:星期五3月02 17:00:13 IST 2012
[信息]最终记忆:13M / 222M
[信息] ------------------------------------------------- -----------------------
[错误]未能执行目标org.apache.maven.plugins:maven-compiler-plugin:2.3。 2:编译(默认编译)项目d:编译失败:编译失败:
[错误]错误:错误读取C:\ Users \Idan\.m2\repository\log4j\log4j \1.2.15\log4j-1.2.15.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\\\\\\\\\\\\\\\\\\\\\\\\\\ -log4j12-1.5.2.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24 \logback-经典0.9.24.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-core\3.3.2.GA\\ \\hibernate芯-3.3.2.GA.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-annotations\3.4.0.GA\\ \\hibernate-注解-3.4.0.GA.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0。 ga\hibernate-公地注解-3.3.0.ga.jar;打开zip文件时出错
[错误]错误:读取错误C:\ Users \Idan\.m2\repository\org\hibernate\hibernate-entitymanager\3.4.0.GA\\ \\hibernate-的EntityManager-3.4.0.GA.jar;打开zip文件时出错
[ERROR]错误:读取错误C:\ Users \Idan\.m2\repository\postgresql\postgresql\9.1-901.jdbc4\postgresql-9.1- 901.jdbc4.jar;打开zip文件时出错
[错误] - > [帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整的调试日志记录。
[错误]
[错误]有关错误和可能解决方案的更多信息,请阅读以下文章:
[错误] [帮助1] http://cwiki.apache.org / confluence / display / MAVEN / MojoFailureExceptio

感谢您的帮助。

解决方案

step1。



清理 .m2\repository 或从 .m2中删除特定文件夹\repository 目录

step2。



运行 mvn clean install



step3。



确保您的互联网连接在运行此命令时正常工作,有时由于连接问题而失败。


I try to run maven install on my project with some dependencies:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.15</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.5.2</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>0.9.24</version>
</dependency>

<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>3.3.2.GA</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-annotations</artifactId>
   <version>3.4.0.GA</version>
</dependency>

the first time I run mvn install it's run just fine (BUILD SUCCESS) but the second time ("after I make some changes in the code") I try to run mvn install and maven throw "error in opening zip file".

[ERROR] error: error reading C:\Users\Idan\.m2\repository\javax\jms\jms\1.1\jms-         1.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\com\sun\jdmk\jmxtools\1.2.1\jmxtools-1.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\com\sun\jmx\jmxri\1.2.1\jmxri-1.2.1.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24\logback-classic-0.9.24.jar; error in opening zip file

but

if I remove log4j, slf4j, and logback-classoc dependencies run maven install (BUILD SUCCESS) return log4j, slf4j, and logback-classic dependencies run maven install it run just fine (BUILD SUCCESS).

What can be the problem?

Update:

well I delete all my .m2/reposetory folder delete all target folder in my project then I run mvn install and I get

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building d 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom (10 KB at 28.9 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire/2.7.1/surefire-2.7.1.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire/2.7.1/surefire-2.7.1.pom (10 KB at 40.7 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/18/maven-parent-18.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/18/maven-parent-18.pom (24 KB at 74.0 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/apache/8/apache-8.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/apache/8/apache-8.pom (14 KB at 43.3 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.jar (29 KB at 50.1 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom (5 KB at 21.0 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.jar
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.jar (23 KB at 40.8 KB/sec)
[WARNING] The POM for log4j:log4j:jar:1.2.15 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.slf4j:slf4j-log4j12:jar:1.5.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for ch.qos.logback:logback-classic:jar:0.9.24 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.hibernate:hibernate-core:jar:3.3.2.GA is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.hibernate:hibernate-annotations:jar:3.4.0.GA is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.hibernate:hibernate-commons-annotations:jar:3.3.0.ga is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.hibernate:hibernate-entitymanager:jar:3.4.0.GA is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for junit:junit:jar:3.8.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for postgresql:postgresql:jar:9.1-901.jdbc4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ d ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ d ---
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom (4 KB at 7.6 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.pom (805 B at 3.4 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler/1.8.1/plexus-compiler-1.8.1.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler/1.8.1/plexus-compiler-1.8.1.pom (4 KB at 11.9 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom (6 KB at 20.7 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom (17 KB at 57.6 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom (6 KB at 10.4 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.pom (713 B at 3.0 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.pom (710 B at 3.0 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compilers/1.8.1/plexus-compilers-1.8.1.pom
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compilers/1.8.1/plexus-compilers-1.8.1.pom (2 KB at 3.9 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.jar
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar (20 KB at 39.4 KB/sec)
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.8.1/plexus-compiler-manager-1.8.1.jar (6 KB at 10.8 KB/sec)
Downloaded: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar (13 KB at 12.3 KB/sec)
[INFO] Compiling 4 source files to D:\projectsWorkspace\connectingtopostgresdbtests\d\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] error: error reading C:\Users\Idan\.m2\repository\log4j\log4j\1.2.15\log4j-1.2.15.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\slf4j\slf4j-log4j12\1.5.2\slf4j-log4j12-1.5.2.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24\logback-classic-0.9.24.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-core\3.3.2.GA\hibernate-core-3.3.2.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-annotations\3.4.0.GA\hibernate-annotations-3.4.0.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0.ga\hibernate-commons-annotations-3.3.0.ga.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-entitymanager\3.4.0.GA\hibernate-entitymanager-3.4.0.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\postgresql\postgresql\9.1-901.jdbc4\postgresql-9.1-901.jdbc4.jar; error in opening zip file
[INFO] 8 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.573s
[INFO] Finished at: Fri Mar 02 17:00:13 IST 2012
[INFO] Final Memory: 13M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project d: Compilation failure: Compilation failure:
[ERROR] error: error reading C:\Users\Idan\.m2\repository\log4j\log4j\1.2.15\log4j-1.2.15.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\slf4j\slf4j-log4j12\1.5.2\slf4j-log4j12-1.5.2.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\ch\qos\logback\logback-classic\0.9.24\logback-classic-0.9.24.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-core\3.3.2.GA\hibernate-core-3.3.2.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-annotations\3.4.0.GA\hibernate-annotations-3.4.0.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0.ga\hibernate-commons-annotations-3.3.0.ga.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\org\hibernate\hibernate-entitymanager\3.4.0.GA\hibernate-entitymanager-3.4.0.GA.jar; error in opening zip file
[ERROR] error: error reading C:\Users\Idan\.m2\repository\postgresql\postgresql\9.1-901.jdbc4\postgresql-9.1-901.jdbc4.jar; error in opening zip file
[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/MojoFailureExceptio

thanks for the help.

解决方案

step1.

Clean your .m2\repository or delete your specific folders from the .m2\repository directory

step2.

run mvn clean install

step3.

be sure that your internet connection is working fine at the time of running this command, some times it fails due to connection problems.

这篇关于maven install throw“在打开zip文件时出错”只有在第二次尝试之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆