Spring Boot

创建项目

Spring Initializr

创建使用Spring Boot

创建完成会自动下载

创建使用Spring Boot

解压后

Idea导入

创建使用Spring Boot

修改国内镜像

网络不够强的话停掉自动更新

build.gradle

加上

repositories {
  # 阿里镜像
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}

再刷新

application.properties

配置

server.port=8086

# 数据源
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/testdb
spring.datasource.username=root
spring.datasource.password=dz520123

# jpa
spring.jpa.database-platform=org.hibernate.dialect.MariaDB10Dialect

# 监控 management.endpoints.web.exposure.include=*

运行既可以做事了

 

Spring Boot特性:

1、starter

2、automatic configuration

3、cli操作

4、监控

 

相关文章:

  • 2021-06-28
  • 2021-08-16
  • 2021-12-12
  • 2023-04-06
  • 2021-08-30
  • 2021-07-06
  • 2021-06-06
  • 2021-10-24
猜你喜欢
  • 2021-11-14
  • 2021-05-31
  • 2021-04-03
  • 2021-07-13
  • 2021-11-29
  • 2021-10-16
  • 2021-09-13
相关资源
相似解决方案