SpringBoot教学资料1-SpringBoot基础
SpringBoot简介
Spring Boot 优点
•可快速构建独立的Spring应用
•直接嵌入Tomcat(无需部署WAR文件)
•提供依赖启动器简化构建配置
•极大程度的自动化配置Spring和第三方库
•提供生产就绪功能
•极少的代码生成和XML配置
•Spring Boot是基于Spring框架开发的全新框架,其设计目的是简化新Spring应用的初始化搭建和开发过程。
•Spring Boot整合了许多框架和第三方库配置,几乎可以达到“开箱即用”
SpringBoot环境配置
jdk,idea,maven,MySQL
https://maven.apache.org/download.cgi
阿里云镜像配置
<---自己的本地maven仓库位置---> <localRepository>D:\java\maven\repository</localRepository>
<---自己的jdk版本配置---> <profile> <id>JDK-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile>
<---阿里云镜像源---> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
idea中默认maven配置
SpringBoot项目的创建
group: com.baidu
配置文件properties、yml语法介绍
#配置数据源 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf-8&severTimezone=UTC spring.datasource.user=root spring.datasource.password=123456 #映射文件路径 mybatis.mapper-locations=classpath:mappers/*Mapper.xml #实体类包名 mybatis.type-aliases-package=com.qfedu.springboot.demo.entity
spring: datasource: url: jdbc:mysql://localhost:3306/id?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC driver-class-name: com.mysql.cj.jdbc.Driver username: root password: 123456 mybatis: mapper-locations: classpath:mappers/*Mapper.xml type-aliases-package: com.qfedu.springboot.demo.entity server: port: 8080 servlet: context-path: /demo1
分类:
springboot
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
2022-07-04 千峰商城-springboot项目搭建-24-vue的style绑定
2022-07-04 千峰商城-springboot项目搭建-23-vue的class绑定