<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <!-- 作用域范围为test --> <scope>test</scope> </dependency>
将<scope>test</scope>注释掉即可
如下:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> </dependency>
原因:scope的作用范围问题,注释掉即可