gpt4 book ai didi

maven - 使用maven命令打开zip文件错误错误

转载 作者:行者123 更新时间:2023-12-02 06:15:31 25 4
gpt4 key购买 nike

我执行了这个命令

mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=trident.MyClass

得到了这个

error: error reading ~/.m2/repository/com/google/guava/guava/13.0/guava-13.0.jar; 
error in opening zip file error: error reading ~/.m2/repository/com/fasterxml
/jackson/core/jackson-core/2.0.0/jackson-core-2.0.0.jar; error in opening zip file
error:
error reading ~/.m2/repository/org/twitter4j/twitter4j-core/3.0.3/twitter4j-
core-3.0.3.jar; error in opening zip file

我是 Maven 新手,这是 Pom 的一部分

<repository>
<id>twitter4j.org</id>
<name>twitter4j.org Repository</name>
<url>http://twitter4j.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

我对 POM 文件的分割代码感到抱歉,因为我收到了大部分代码的消息,应该添加详细信息

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-stream</artifactId>
<version>3.0.3</version>
</dependency>
</dependencies>

以及POM文件的这部分

 <build>   
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>twitter4j.properties</include>
<include>config.properties</include>
</includes>
</resource>
</resources>

当我提取这些 jar 文件之一时出现错误

End-of-central-directory signature not found. Either this file is not a zipfile, or it 
constitutes one disk of a multi-part archive. In the latter case the central directory
and zipfile comment will be found on the last disk(s) of this archive. zipinfo: cannot
find zipfile directory in one of ~/.m2/repository/com/google/guava/guava/13.0/guava-
13.0.jar ~/.m2/repository/com/google/guava/guava/13.0/guava-13.0.jar.zip, and cannot
find ~/.m2/repository/com/google/guava/guava/13.0/guava-13.0.jar.ZIP, period

出现错误的警告

[WARNING] POM for 'com.google.guava:guava:pom:13.0:provided' is invalid. Its 
dependencies (if any) will NOT be available to the current build. [WARNING] POM for
'com.fasterxml.jackson.core:jackson-core:pom:2.0.0:compile' is invalid. Its
dependencies (if any) will NOT be available to the current build. [WARNING] POM for
'org.twitter4j:twitter4j-core:pom:3.0.3:compile' is invalid. Its dependencies (if any)
will NOT be available to the current build. [WARNING] POM for 'org.twitter4j:twitter4j-
stream:pom:3.0.3:compile' is invalid.

最佳答案

jar 文件似乎已损坏 - 您可以手动删除它 (rm ~/.m2/repository/com/google/guava/guava/13.0/guava-13.0.jar) ,当您运行 mvn install 时,maven 会重新下载它。

关于maven - 使用maven命令打开zip文件错误错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25419042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com