I have a java jersey spring based maven application. I imported into my Eclipse, and when Maven starts downloading all dependencies (jars), they are all corrupted with very low sized files(<10kb). I deleted the .m2 repo and ran the mvn clean install command multiple times, but I still get the same corrupted files.
Is there something wrong with pom.xml? Below is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kreator.rest</groupId>
<artifactId>kreatorRestServices</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>kreatorRestServices Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven2-repository.java.nettt</id>
<url>https://mvnrepository.com/artifact/org.glassfish.jersey.ext/jersey-spring3</url>
</repository>
</repositories>
<!-- Specifying the Versions of Spring, Hiberante, MySQL etc -->
<properties>
<hibernate.version>4.3.8.Final</hibernate.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<version>2.11</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.2.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>11.2.0.2.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>kreatorRestServices</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>2.0.3</version>
<configuration>
<appName>kreatorbackendservices</appName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>9.0.30.0</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And the error I see (when i run the build):
[WARNING] The POM for commons-lang:commons-lang:jar:2.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.velocity:velocity:jar:1.7 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.postgresql:postgresql:jar:42.2.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for commons-logging:commons-logging:jar:1.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.springframework:spring-orm:jar:4.3.2.RELEASE is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for javax.persistence:javax.persistence-api:jar:2.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.fasterxml.jackson.core:jackson-core:jar:2.5.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
. . . .
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 38 source files to C:\Users\charrj\Documents\kreatorjavatoolservices\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /C:/Users/charrj/Documents/kreatorjavatoolservices/src/main/java/com/pojo/Screen.java: Some input files use unchecked or unsafe operations.
[WARNING] /C:/Users/charrj/Documents/kreatorjavatoolservices/src/main/java/com/pojo/Screen.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\postgresql\postgresql\42.2.1\postgresql-42.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-orm\4.3.2.RELEASE\spring-orm-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.5.0\jackson-core-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.5.0\jackson-databind-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.5.0\jackson-annotations-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\core\jersey-server\2.11\jersey-server-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\ext\jersey-spring3\2.11\jersey-spring3-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\media\jersey-media-json-jackson\2.22.2\jersey-media-json-jackson-2.22.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-core\4.3.2.RELEASE\spring-core-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-beans\4.3.2.RELEASE\spring-beans-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context\4.3.2.RELEASE\spring-context-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-web\4.3.2.RELEASE\spring-web-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context-support\4.3.2.RELEASE\spring-context-support-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-aop\4.3.2.RELEASE\spring-aop-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjweaver\1.6.11\aspectjweaver-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-jdbc\4.3.2.RELEASE\spring-jdbc-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\oracle\ojdbc5\11.2.0.2.0\ojdbc5-11.2.0.2.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-core\4.3.8.Final\hibernate-core-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-c3p0\4.3.8.Final\hibernate-c3p0-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\postgresql\postgresql\42.2.1\postgresql-42.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-orm\4.3.2.RELEASE\spring-orm-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.5.0\jackson-core-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.5.0\jackson-databind-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.5.0\jackson-annotations-2.5.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\core\jersey-server\2.11\jersey-server-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\ext\jersey-spring3\2.11\jersey-spring3-2.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\glassfish\jersey\media\jersey-media-json-jackson\2.22.2\jersey-media-json-jackson-2.22.2.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-core\4.3.2.RELEASE\spring-core-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-beans\4.3.2.RELEASE\spring-beans-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context\4.3.2.RELEASE\spring-context-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-web\4.3.2.RELEASE\spring-web-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-context-support\4.3.2.RELEASE\spring-context-support-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-aop\4.3.2.RELEASE\spring-aop-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjrt\1.6.11\aspectjrt-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\aspectj\aspectjweaver\1.6.11\aspectjweaver-1.6.11.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\springframework\spring-jdbc\4.3.2.RELEASE\spring-jdbc-4.3.2.RELEASE.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\com\oracle\ojdbc5\11.2.0.2.0\ojdbc5-11.2.0.2.0.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-core\4.3.8.Final\hibernate-core-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\org\hibernate\hibernate-c3p0\4.3.8.Final\hibernate-c3p0-4.3.8.Final.jar; error in opening zip file
[ERROR] error reading C:\Users\charrj\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar; error in opening zip file
Any help will be much appreciated. I can't go and download jars manually, because I'm trying to deploy the app on Heroku as well, so that anyway will try to download the files again. So it is not just my local .m2 repo alone that's affected because of this.