pro
pro copied to clipboard
Module not found during test when requiring a module with no test
Given a module a
requiring a module b
, with the former having a test but not the latter, tests ran by the tester
plugin fail with a java.lang.module.FindException: Module b not found, required by a
.
A workaround for this is to create an empty test module for b
in such a way that the target "exploded" and "merged" test folders are properly generated.
Non-working tree:
├── build.pro
├── src
│ ├── main
│ │ └── java
│ │ ├── a
│ │ │ └── module-info.java
│ │ └── b
│ │ └── module-info.java
│ └── test
│ └── java
│ └── a
│ └── module-info.java
└── target
├── main
│ └── exploded
│ ├── a
│ │ └── module-info.class
│ └── b
│ └── module-info.class
└── test
├── exploded
│ └── a
│ └── module-info.class
└── merged
└── a
└── module-info.java
Working tree:
├── build.pro
├── src
│ ├── main
│ │ └── java
│ │ ├── a
│ │ │ └── module-info.java
│ │ └── b
│ │ └── module-info.java
│ └── test
│ └── java
│ ├── a
│ │ └── module-info.java
│ └── b
│ └── module-info.java
└── target
├── main
│ └── exploded
│ ├── a
│ │ └── module-info.class
│ └── b
│ └── module-info.class
└── test
├── exploded
│ ├── a
│ │ └── module-info.class
│ └── b
│ └── module-info.class
└── merged
├── a
│ └── module-info.java
└── b
└── module-info.java
Seen to be a bug when we analyze the module graph from merged, the source module should be used as a backup (the one from main/java)