When trying to run tests using command mvn test I receive an error:
[ERROR] There was an error in the forked process
[ERROR] java.lang.NoClassDefFou
java.lang.NoClassDefFoundError: org/junit/platform/commons/PreconditionViolationException when trying run junit5 test with maven
This error can be come due to the version mismatch of junit-plateform-engine junit-jupiter-params and junit-platform-runner and also other respective dependencies.
So for the resolution of this issue you do not need to define version like 1.5.3 ...etc
you can define version as follows :
org.junit.jupiter
junit-jupiter-params
**${junit.jupiter.version} **
test
org.junit.jupiter
junit-jupiter-engine
**${junit.jupiter.version} **
test
org.junit.platform
junit-platform-runner
**${junit.platform.version} **
test
So through this compatible version jar will be added in your project and project will run successfully