IDEA中Junit使用注意事项

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

如图当junit依赖的scope域范围被设置成test时,在项目中是不能在类方法上@Test进行测试运行的,相当于整个jar包都被隐藏了,这可能跟IDEA的编译构建规则有关,是跟Eclipse中不同的地方。在以后的使用中要注意了,也要注意继承的父工程中也去掉父依赖的scope设置。不然就跟我一样悲催的搞了一晚上。

猜你喜欢

转载自my.oschina.net/u/3744350/blog/1621580