In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about how to configure the SpringBoot environment. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
I. Pom File configuration 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
Related starter series coordinate reference:
The name describes spring-boot-starter core Spring Boot starter, including automatic configuration support, logging and YAMLspring-boot-starter-actuator production preparation features to help us monitor and manage application spring-boot-starter-amqp support for Advanced message queuing Protocol, spring-boot-starter-aop support for aspect-oriented programming through spring-rabbit, including spring-aop and AspectJspring-boot-starter-batch support for Spring Batch Including HSQLDB database spring-boot-starter-cloud-connectors support for Spring Cloud Connectors, simplifying connections to cloud services (for example, Cloud Foundry and Heroku) spring-boot-starter-data-elasticsearch support for Elasticsearch search and analysis engines, including spring-data-elasticsearchspring-boot-starter-data-gemfire support for GemFire distributed data storage, including spring-data-gemfirespring-boot-starter-data-jpa support for "Java persistence API", including spring-data-jpa Spring-orm and Hibernatespring-boot-starter-data-mongodb support for MongoDB NOSQL databases, including spring-data-mongodbspring-boot-starter-data-rest support for exposing Spring Data repositories through REST, and spring-boot-starter-data-solr support for Apache Solr search platform through spring-data-rest-webmvc Including spring-data-solrspring-boot-starter-freemarker support for FreeMarker template engine, spring-boot-starter-groovy-templates support for Groovy template engine, spring-boot-starter-hateoas support for HATEOAS-based RESTful services, spring-boot-starter-hornetq support for "Java message Service API" through spring-hateoas Implement spring-boot-starter-integration 's support for ordinary spring-integration modules through HornetQ spring-boot-starter-jdbc 's support for JDBC database spring-boot-starter-jersey 's support for Jersey RESTful Web service framework spring-boot-starter-jta-atomikos 's support for JTA distributed transactions and spring-boot-starter-jta-bitronix 's support for JTA distributed transactions through Atomikos Implement spring-boot-starter-mail 's support for javax.mail through Bitronix spring-boot-starter-mobile 's support for spring-mobile spring-boot-starter-mustache 's support for Mustache template engine spring-boot-starter-redis 's support for REDIS key data storage Including spring-redisspring-boot-starter-security 's support for spring-security, spring-boot-starter-social-facebook 's support for spring-social-facebook, spring-boot-starter-social-linkedin 's support for spring-social-linkedin, spring-boot-starter-social-twitter 's support for spring-social-twitter, spring-boot-starter-test 's support for common test dependencies, including JUnit, Hamcrest and Mockito, and spring-test module spring-boot-starter-thymeleaf 's support for Thymeleaf template engine Including integration with Spring spring-boot-starter-velocity support for Velocity template engine spring-boot-starter-web support for full-stack web development, including Tomcat and spring-webmvcspring-boot-starter-websocket support for WebSocket development, spring-boot-starter-ws support for Spring Web services II, yml file configuration
The yml file is placed in the resources directory
# # Port number context path server: port: 8989 servlet: context-path: / mvc## data source configuration 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 # Response format charset: UTF-8 template-loader-path: classpath:/views/ # # Hot deployment configuration devtools: restart: enabled: true # sets the directory to restart Adding directory files requires restart additional-paths: src/main/java # to solve the problem of interface report 404 after automatic recompilation of the project poll-interval: 3000 quiet-period: 1000 # # Ehcache cache configuration cache: ehcache: config: classpath:ehcache.xml # # mybatis configuration mybatis: # storage path of the mapping file mapper-locations: classpath:/mappers/*.xml Type-aliases-package: com.xxxx.springboot.po configuration: # # underlined hump configuration map-underscore-to-camel-case: true## pageHelperpagehelper: helper-dialect: mysql## shows dao executes sql statements logging: level: com: xxxx: dao: debug III. SQL Mapping File configuration
Sql mapping file path is under "resources/mappers/"
IV. Ehcahe.xml file
Configure under resources
These are all the contents of the article "how to configure the SpringBoot Environment". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.