junit5-samples icon indicating copy to clipboard operation
junit5-samples copied to clipboard

Add module-info.java to have an example that works with Jigsaw too.

Open Brixomatic opened this issue 3 years ago • 1 comments

Unfortunately this simple example doesn't show how to meaningfully combine JUnit with Jigsaw. If I'm not mistaken, junit should not be in the "requires" section of the module-info,java, as it is not required by the module, only by its tests.

Brixomatic avatar Aug 07 '22 14:08 Brixomatic

Short answer: Create dedidated (project-internal) test modules (that binaries are not published to an external repository).

Or: JUnit should not be a dependency of the main scope, as it is not used by main classes, only by its tests.

Longer answer: https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world

sormuras avatar Aug 07 '22 15:08 sormuras