As of IDEA 2018.2.1, the IDE starts error-highlighting packages \"not
in the module graph\" from dependencies that have been modularized. I added a module-info.java
Beside @Slaw's answer (thanks to him), I had to open the package that contains the resources to the caller's module. As follows (moduleone.name module-info.java):
opens io.fouad.packageone to moduletwo.name;
Otherwise, the following would return null:
A.class.getResource("/io/fouad/packageone/logging.properties");
considering that class A is in module moduletwo.name and the file logging.properties is inside module moduleone.name.
Alternatively, moduleone.name could expose a utility method that returns the resource:
public static URL getLoggingConfigFileAsResource()
{
return A.class.getResource("/io/fouad/packageone/logging.properties");
}