Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven clean install COMPILATION ERROR cannot access jar, zip END header not found

When building my application on Jenkins using maven I am seeing the following error after running:

mvn clean install -q -U -T 1.5C -DskipTests -Dsvn.info.skip=true

Error:

** [ERROR] COMPILATION ERROR : [ERROR] error reading /apps/jenkins/workspace/some_branch/.m2/com.some_company/any_random.jar; zip file is empty
[ERROR] cannot access com.some_company.some_class cannot access cannot access com.some_company.some_class zip END header not found cannot access jar


I tried excluding the dependency that was causing the issue as it was transitive but now it happens for other dependencies.

The dependencies are stored in nexus.

I have looked at the JDK being used to build the JARS and considered Network issues but nothing explains this.

Clearing Jenkins and the .m2 folder works sometime for one or two builds but I would like to find a better solution.

Any ideas?

like image 357
clD Avatar asked Mar 14 '19 16:03

clD


1 Answers

Just delete the file

.m2/com.some_company/any_random.jar

and rerun your goal again. maybe your network or internet connection is slow or your hard disk need check.

like image 136
Mohannd Avatar answered Sep 21 '22 11:09

Mohannd