IntelliJ Compilation Error zip END header not found

前端 未结 8 2319
花落未央
花落未央 2021-02-07 09:09

The Issue

I am unable to compile Java code for an imported Eclipse project on IntelliJ build 182.4505.22 on Java 9 and 10. The following error is displa

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 10:00

    This can also occurs when you use a dependency that requires to be of type pom (to transitively add all dependencies, useful for BOMs) but without specifying it.

    For example if you have a Spring Boot project and use that starter :

    
        org.zkoss.zkspringboot
        zkspringboot-starter
        ${zkspringboot.version}
    
    

    Then mvn clean package will give you the following error :

    Error: java: cannot access com.example.myproject

    And running the app will result in the following error :

    java: error reading ...\.m2\repository\org\zkoss\zkspringboot\zkspringboot-starter\2.3.0\zkspringboot-starter-2.3.0.jar; zip END header not found

    because it should not perform any packaging.

    Adding the pom packaging type fixes the problem, so that it keeps the artifact simply as a descriptor of dependency versions :

    
        org.zkoss.zkspringboot
        zkspringboot-starter
        ${zkspringboot.version}
        pom
    
    

提交回复
热议问题