关于junit的Failed to resolve org.ju

2020-02-09  本文已影响0人  你好世界12345

我的理解是,在setting文件中本地仓库中找不到这个启动项的jar包,但是在.m2文件夹中也找不到,我自己翻了本地磁盘目录里面确实没有jar包,就在pom文件中贴上依赖,idea自动导入一下,就解决问题了

去mevan仓库中,我贴一下链接

https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher/1.5.2

把下面这段贴入pom文件的依赖中,让idea自动导入依赖

<!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher -->

<dependency>

    <groupId>org.junit.platform</groupId>

    <artifactId>junit-platform-launcher</artifactId>

    <version>1.5.2</version>

    <scope>test</scope>

</dependency>

在测试类中@springboottest注解不管是上面还是下面添加注解@ExtendWith(SpringExtension.class),运行试一下,应该就没有问题了。

上一篇 下一篇

猜你喜欢

热点阅读