Search code examples
javamavenjunit

ZipException when running maven build


While running mvn clean install I got the following Exception and mvn process resulted in failure.

Exception:-

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] AbcTest.java:[1,1] cannot access com.company.abc
 ZipException opening "junit-platform-engine-1.9.3.jar": invalid block type

Solution

  • As mentioned in the exception, we can see it is failing on library junit-platform-engine-1.9.3.jar .

    Hence we can conclude that there is some problem with downloaded library jar which would be available in the maven repository. So we need to delete the contents of the folder at

    <m2 repo location>/org/junit/platform/junit-platform-engine Then re run the build