Details
Description
The snapshot releases of log4j-api and log4j-core are currently generated with an empty Automatic-Module-Name header within their manifests. As Java 9 will look for this header first, it is impossible to compile against (with the exception of the maven-compiler-plugin which seems to circumvent this issue somehow) or load these jars even when a module-info.class is present (see below).
This issue currently only affects 2.10.1-SNAPSHOT and 3.0.0-SNAPSHOT versions and prevents developers from integrating log4j in their modular projects entirely (since the latest stable release (2.10.0) is affected by LOG4J2-2129 and thus fails to load within these environments as well).
A test project which will produce the errors outlined below is available here (compiler errors only seem to occur within IDEs, runtime errors do occur regardless of compilation method).
Error Messages
java: cannot determine module name for <home>\.m2\repository\org\apache\logging\log4j\log4j-core\2.10.1-SNAPSHOT\log4j-core-2.10.1-20180131.145844-171.jar
java: cannot determine module name for <home>\.m2\repository\org\apache\logging\log4j\log4j-core\3.0.0-SNAPSHOT\log4j-core-3.0.0-20180216.142957-18.jar
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for target\log4j-core-3.0.0-SNAPSHOT.jar
Caused by: java.lang.module.FindException: Automatic-Module-Name: : Invalid module name: '' is not a Java identifier