Error opening zip file error with maven command

I ran this command

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

and got it

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

I'm new to maven and this is part of 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> 

I apologize for the farewell code of the POM file, because I received a message for most of the code and must add information

<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>

and this part of the POM file

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

Error received while extracting one of these jar files

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

Error warning

[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.
+4
source share
2 answers

It seems that the jar file is corrupted - you can delete it manually ( rm ~/.m2/repository/com/google/guava/guava/13.0/guava-13.0.jar), and maven will reload it for you when you run it mvn install.

+4
source

Add the repository tag to the POM file. And run as Maven Build

<repositories>
    <repository>
        <id>central</id>
        <name>Central Repository</name>
        <url>https://repo1.maven.org/maven2</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
0
source

All Articles