There are test failures. Please refer to /Users/andy_mac/CodeSpace/springboot/springboot202304/demo/

文章描述了在SpringBoot项目中遇到的两个主要问题:一是测试失败,解决方案是注释掉ApplicationTests类中的特定测试代码;二是缺少mysql-connector-java依赖,提供了两种解决方法,包括手动下载JAR文件添加到项目和通过Maven仓库引入正确的依赖配置。
摘要由CSDN通过智能技术生成

报错信息1:There are test failures. Please refer to /Users/andy_mac/CodeSpace/springboot/springboot202304/demo/target/surefire-reports for the individual test results. Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

 

解决方法:

只需在 ApplicationTests 类中注释掉以下内容:

@SpringBootTest
class DemoApplicationTests {

//	@Test
//	void contextLoads() {
//	}

}

 报错信息2:mysql:mysql-connector-java:jar is missing.

Could not transfer artifact mysql:mysql-connector-java:pom:>5.1.9 from/to aliyun (https://maven.aliyun.com/repository/public)

推荐方法2


解决方法1:下载mysql-connector-java.jar

Download MySQL Connector/J for Mac | MacUpdate

右键项目名字--Open module setting模块设置--Libraries--点加号--选择java--选择自己的mysql- connector-java.jar--ok

方法2:从maven仓库引入依赖

https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.0.31

<!-- 正确的
https://mvnrepository.com/artifact/com.mysql/mysql-connector-j -->
<dependency>
    <groupId>com.mysql</groupId>
    <artifactId>mysql-connector-j</artifactId>
    <version>8.0.31</version>
</dependency>
我写的是


<dependency>
        			<groupId>mysql</groupId>
        			<artifactId>mysql-connector-java</artifactId>
        <!--			<version>8.0.29</version>-->
        		</dependency>

还有的写的是,这个真是写的五花八门
 <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Roam-G

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值