mvn compile时报错

报错:maven 程序包org.junit不存在

解决方法:

将pom.xml中的原本的

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.9</version>
      <scope>test</scope>
    </dependency>

  改成

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.9</version>
    </dependency>

 

相关文章: