关于初次new springboot项目

如果是新手初学,然后做springboot项目报各种错,改来改去最终都无法出现successful字样。

请先检查,maven环境是否配好。

maven环境决定你下载依赖的速度,以及能否下载成功。

maven管理你的springboot项目,所以配置它的环境是必不可少的。

比如未配置maven环境直接运行项目可能会报以下错误。

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

java: 无法访问jakarta.persistence.Column 错误的类文件: balabala...

警告: Runner org.junit.internal.runners.ErrorReportingRunner (used on com.itheima.BookJpaTests) does not support filtering and will therefore be run completely. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.itheima.BookJpaTests': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.

NoSuchBeanDefinitionException: No qualifying bean of type 'com.itheima.stutest01.repository.BookRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:balabala

可能有些帖子写,无启动类路径。如果maven环境一开始有配好,new出来的项目,自带balalbatest.java的文件,中是自带启动注解的

复制代码
@RunWith(SpringRunner.class)

------->

复制代码
 
相关推荐
有没有没有重复的名字28 分钟前
线程安全的单例模式与读者写者问题
java·开发语言·单例模式
程序员的世界你不懂2 小时前
基于Java+Maven+Testng+Selenium+Log4j+Allure+Jenkins搭建一个WebUI自动化框架(4)集成Allure报表
java·selenium·maven
isNotNullX2 小时前
数据中台架构解析:湖仓一体的实战设计
java·大数据·数据库·架构·spark
皮皮林5512 小时前
“RPC好,还是RESTful好?”,这个问题不简单
java
Xiaouuuuua2 小时前
一个简单的脚本,让pdf开启夜间模式
java·前端·pdf
车车不吃香菇3 小时前
java idea 本地debug linux服务
java·linux·intellij-idea
浩瀚星辰20244 小时前
图论基础算法:DFS、BFS、并查集与拓扑排序的Java实现
java·算法·深度优先·图论
LjQ20404 小时前
Java的一课一得
java·开发语言·后端·web
苦学编程的谢4 小时前
SpringBoot项目的创建
java·spring boot·intellij-idea
武昌库里写JAVA4 小时前
vue3面试题(个人笔记)
java·vue.js·spring boot·学习·课程设计