Import-on-demand declaration with subpackages only
Related : How can I compile "import pack.*" with ant/javac, when there are no such classes? Suppose we have the given package structure parent | ---a ---b where the package parent only contains the two subpackges a and b (no class is under the package parent ). The code import parent.* , situated in a package other than parent , compiled with Maven (i.e. javac ) throws a compile-time error. The error is: package parent does not exist I looked into the Java Language Specification about such a case (import-on-demand declaration where no types are actually imported). Paragraph 7.5.2 of the JLS