Maven 3 and JUnit 4 compilation problem: package org.junit does not exist

前端 未结 16 1486
时光取名叫无心
时光取名叫无心 2020-12-13 12:06

I am trying to build a simple Java project with Maven. In my pom-file I declare JUnit 4.8.2 as the only dependency. Still Maven insists on using JUnit version 3.8.1. How do

16条回答
  •  温柔的废话
    2020-12-13 12:42

    By default , maven looks at these folders for java and test classes respectively - src/main/java and src/test/java

    When the src is specified with the test classes under source and the scope for junit dependency in pom.xml is mentioned as test - org.unit will not be found by maven.

提交回复
热议问题