java.lang.NoClassDefFoundError: org/junit/platform/commons/PreconditionViolationException when trying run junit5 test with maven

后端 未结 8 1893
抹茶落季
抹茶落季 2020-12-10 00:56

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         


        
8条回答
  •  醉酒成梦
    2020-12-10 01:38

    The following worked for me using surefire.plugin.version 2.22.2

    junit-jupiter artifact brings in all other necessary artifacts.

    
      
        
          org.junit
          junit-bom
          5.5.2
          pom
          import
        
      
    
    
      
        org.junit.jupiter
        junit-jupiter
        test
      
      
      
        org.junit.vintage
        junit-vintage-engine
        test
      
    
    

提交回复
热议问题