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