IDEA| Spring Boot项目中@SpringBootTest测试的时候卡住,一直Resolving Juint-platform-engine/1.6.2........

        今天在springboot项目中做单元测试时候用到@Test时,总是卡在加载Resolving Juint-platform-engine/1.6.2........中,然后一直加载不出来,着实让人上火。关键是:还取消不掉!!!!无奈只能强制关闭IDEA软件。

 查看了网上多种解决方法,我也是挨个都试了遍,就一种方法成功了,因此,在这里写个文为大家总结一下这个坑的各种解决方案,方案千万种,总有一种适合你,愿下辈子没有bug(巴拉巴拉)。

  • 解决方案1:(本人服用后效果甚佳)

引入以下依赖即可,据说是IDEA与junit5的的一个bug问题。简直尼玛是神级坑!

 <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <scope>test</scope>
  </dependency>

解决方案2:(本人然并卵)

打开Settings ,修改maven Importing的jvm参数, 默认为700多, 直接修改成 -Xms1024m -Xmx2048m。

解决方案3: (服用后和方案1效果差不多,还少导一个包,或许本身就有呢~)

重启后在pom.xml添加以下依赖代码:

<dependency>
    <!-- this is needed or IntelliJ gives junit.jar or junit-platform-launcher:1.3.2 not found errors -->
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-launcher</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    <scope>test</scope>
</dependency>

解决方案4:(本人然并卵)

        更换到阿里云镜像服务器。修改maven配置文件 $M2_HOME/conf/settings.xml (也可以在用户 home 目录 .m2 下面添加一个 settings.xml 文件),添加:

<mirror>
  <id>nexus-aliyun</id>
  <mirrorOf>*</mirrorOf>
  <name>Nexus aliyun</name>
  <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

Tips: 之所以会试这么多种方法纯粹是运气不好,看看方案1多简介明了,要是运气好首先用那种方法立马就成功了呢!

如果有其他新的方法欢迎评论留言交流哦,还好我是跳出坑了哈哈!

 

 

 

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值