How do I open packages and require dependencies on test scope modules only for JUnit testing
- 阅读更多 关于 How do I open packages and require dependencies on test scope modules only for JUnit testing
I'm migrating a jar project from java 10 using classpath to java 11 using the java 9 jigsaw modules. There are JUnit5 tests for the project. The test dependencies are provided at test scope by maven. How to make all packages open for testing but not open when the module is used by another project? The jar project is just providing a few classes (like a utility project) for other projects (so no main class needed). The project got 5 packages at /src/main/java/a/b/c/ . 2 of them should be accessible for projects using this jar. The other 3 are for internal use only (used by the accessible ones).