如何配置SpringBoot环境
发表于:2025-02-02 作者:千家信息网编辑
千家信息网最后更新 2025年02月02日,今天小编给大家分享一下如何配置SpringBoot环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一
千家信息网最后更新 2025年02月02日如何配置SpringBoot环境
今天小编给大家分享一下如何配置SpringBoot环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
一、pom文件配置
org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE org.springframework.boot spring-boot-starter-web org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.1 com.github.pagehelper pagehelper-spring-boot-starter 1.2.13 mysql mysql-connector-java com.mchange c3p0 0.9.5.5 org.springframework.boot spring-boot-starter-freemarker org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-starter-mail org.springframework.boot spring-boot-starter-aop org.springframework.boot spring-boot-starter-logging org.springframework.boot spring-boot-starter-tomcat provided org.apache.commons commons-lang3 io.springfox springfox-swagger2 2.9.2 io.springfox springfox-swagger-ui 2.9.2 org.springframework.boot spring-boot-devtools true org.springframework.boot spring-boot-starter-test org.springframework.boot spring-boot-starter-cache net.sf.ehcache ehcache springboot org.springframework.boot spring-boot-maven-plugin org.springframework.boot spring-boot-maven-plugin true
相关starter系列坐标参考:
名称 | 描述 |
---|---|
spring-boot-starter | 核心Spring Boot starter,包括自动配置支持,日志和YAML |
spring-boot-starter-actuator | 生产准备的特性,用于帮我们监控和管理应用 |
spring-boot-starter-amqp | 对"高级消息队列协议"的支持,通过spring-rabbit实现 |
spring-boot-starter-aop | 对面向切面编程的支持,包括spring-aop和AspectJ |
spring-boot-starter-batch | 对Spring Batch的支持,包括HSQLDB数据库 |
spring-boot-starter-cloud-connectors | 对Spring Cloud Connectors的支持,简化在云平台下(例如,Cloud Foundry 和Heroku)服务的连接 |
spring-boot-starter-data-elasticsearch | 对Elasticsearch搜索和分析引擎的支持,包括spring-data-elasticsearch |
spring-boot-starter-data-gemfire | 对GemFire分布式数据存储的支持,包括spring-data-gemfire |
spring-boot-starter-data-jpa | 对"Java持久化API"的支持,包括spring-data-jpa,spring-orm和Hibernate |
spring-boot-starter-data-mongodb | 对MongoDB NOSQL数据库的支持,包括spring-data-mongodb |
spring-boot-starter-data-rest | 对通过REST暴露Spring Data仓库的支持,通过spring-data-rest-webmvc实现 |
spring-boot-starter-data-solr | 对Apache Solr搜索平台的支持,包括spring-data-solr |
spring-boot-starter-freemarker | 对FreeMarker模板引擎的支持 |
spring-boot-starter-groovy-templates | 对Groovy模板引擎的支持 |
spring-boot-starter-hateoas | 对基于HATEOAS的RESTful服务的支持,通过spring-hateoas实现 |
spring-boot-starter-hornetq | 对"Java消息服务API"的支持,通过HornetQ实现 |
spring-boot-starter-integration | 对普通spring-integration模块的支持 |
spring-boot-starter-jdbc | 对JDBC数据库的支持 |
spring-boot-starter-jersey | 对Jersey RESTful Web服务框架的支持 |
spring-boot-starter-jta-atomikos | 对JTA分布式事务的支持,通过Atomikos实现 |
spring-boot-starter-jta-bitronix | 对JTA分布式事务的支持,通过Bitronix实现 |
spring-boot-starter-mail | 对javax.mail的支持 |
spring-boot-starter-mobile | 对spring-mobile的支持 |
spring-boot-starter-mustache | 对Mustache模板引擎的支持 |
spring-boot-starter-redis | 对REDIS键值数据存储的支持,包括spring-redis |
spring-boot-starter-security | 对spring-security的支持 |
spring-boot-starter-social-facebook | 对spring-social-facebook的支持 |
spring-boot-starter-social-linkedin | 对spring-social-linkedin的支持 |
spring-boot-starter-social-twitter | 对spring-social-twitter的支持 |
spring-boot-starter-test | 对常用测试依赖的支持,包括JUnit, Hamcrest和Mockito,还有spring-test模块 |
spring-boot-starter-thymeleaf | 对Thymeleaf模板引擎的支持,包括和Spring的集成 |
spring-boot-starter-velocity | 对Velocity模板引擎的支持 |
spring-boot-starter-web | 对全栈web开发的支持, 包括Tomcat和spring-webmvc |
spring-boot-starter-websocket | 对WebSocket开发的支持 |
spring-boot-starter-ws | 对Spring Web服务的支持 |
二、yml文件配置
yml文件放在resources目录下
## 端口号 上下文路径server: port: 8989 servlet: context-path: /mvc## 数据源配置spring: datasource: type: com.mchange.v2.c3p0.ComboPooledDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/hr username: root password: root freemarker: suffix: .ftl content-type: text/html #响应格式 charset: UTF-8 template-loader-path: classpath:/views/ ## 热部署配置 devtools: restart: enabled: true # 设置重启的目录,添加目录的文件需要restart additional-paths: src/main/java # 解决项目自动重新编译后接口报404的问题 poll-interval: 3000 quiet-period: 1000 ## Ehcache缓存配置 cache: ehcache: config: classpath:ehcache.xml ## mybatis 配置mybatis: #映射文件的存放路径 mapper-locations: classpath:/mappers/*.xml type-aliases-package: com.xxxx.springboot.po configuration: ## 下划线转驼峰配置 map-underscore-to-camel-case: true## pageHelperpagehelper: helper-dialect: mysql## 显示dao 执行sql语句logging: level: com: xxxx: dao: debug
三、SQL映射文件配置
sql映射文件路径在"resources/mappers/"下
四、ehcahe.xml 文件
配置在resources下
以上就是"如何配置SpringBoot环境"这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注行业资讯频道。
支持
配置
文件
引擎
数据
模板
服务
知识
篇文章
分布式
数据库
目录
路径
环境
事务
内容
平台
模块
消息
参考
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全犯罪包括
软件开发相关专业介绍
怎么有个安全的服务器
大学网络数据库课程设计心得体会
企业管理软件开发服务价格
王银博软件开发
SQL可以建设数据库后端嘛
上海车匠互联网科技有限公司
怎么用服务器挂京东脚本
越秀高校网络安全建设
上传失败无法连接服务器怎么办
津如意互联网科技有限公司
湖北综合软件开发定做价格
濮阳软件开发税务筹划
数据库系统原理试卷
云视通互联网科技
英伟达a2 服务器
creo工作区与服务器同步
软件开发工程师技术分享
计算机软件开发的利润一般
天津综合服务管理软件开发
网络硬盘的服务器地址
办公网络安全自查
千人基因组计划数据库
全国网络安全周微课作品
网络技术达不到工程师级别
人员组成图软件开发
数据库与应用软件如何连接
河南统一软件开发价钱
数据库 excel查询