I have read about modularity since Java 9. I am aware I have to create a module-info and infor which package is exposed and required. I can see I do have Java 11 on my classpath. But I am getting the error mentioned on topic. More precisely, while building, I get this error log
INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ zuul ---
[WARNING] Can't extract module name from xpp3_min-1.1.4c.jar: Provider class org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer not in module
[WARNING] ********************************************************************************************************************
[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
[WARNING] ********************************************************************************************************************
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\_d\WSs\soteste\zuul\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/_d/WSs/soteste/zuul/src/main/java/module-info.java:[24,18] module not found: common
[INFO] 1 error
I am missing some extra setup in order to make the class from common project visible to other project?
PS1: I followed Import XXX cannot be resolved for Java SE standard classes and setup to alternative JRE. PS2.: I don't think this has something related to Eclipse. BTW, I am using this version:
Eclipse IDE for Enterprise Java Developers. Version: 2018-12 (4.10.0) Build id: 20181214-0600 OS: Windows 10, v.10.0, x86_64 / win32 Java version: 11.0.2
In my zuul project:
import com.test.common.security.JwtConfig;
@EnableWebSecurity
public class SecurityTokenConfig extends WebSecurityConfigurerAdapter {
@Autowired
private JwtConfig jwtConfig;
...
module-info.java
module zuul {
...
requires common;
}
In my common project
@Getter
@ToString
public class JwtConfig {
...
module-info.java
module common {
exports com.test.common.security;
exports com.test.common;
...
}