Spring Boot 入门笔记

这篇博客介绍了Spring Boot入门,包括依赖管理、最佳实践、运行应用、禁用Thymeleaf缓存、代码结构建议、配置类、自动配置和开发者工具的使用。强调了Spring Boot与特定Spring版本的关联,以及如何通过Maven或Gradle创建可执行jar。
摘要由CSDN通过智能技术生成

Spring Boot 入门

  • Build systems: Maven | Gradle | Ant | Starter POMs
  • Best practices: Code Structure | @Configuration | @EnableAutoConfiguration | Beans and Dependency Injection
  • Running your code: IDE | Packaged | Maven| Gradle
  • Package your app: Production jars
  • Spring Boot CLI: Using the CLI

Tips:

Spring Boot use Java SDK v1.6 or higher, running in Tomcat 7.0 or higher.
Maven compile sources from src/main/java folder by defaule.
SpringApplication will bootstrap our application, starting Spring which will in turn start the auto-configured Tomcat web server.
Executable jars (sometimes called “fat jars”) are archives containing your compiled classes along with all of the jar dependencies that your code needs to run.
project.version.SNAPSHOT.jar.original is the original jar file that Maven created before it was repackaged by Sping Boot.
To create an executable jar we need to add the spring-boot-maven-plugin to our pom.xml.
Each release of Spring Boot is associated with a base version of the Spring Framework so we highly recommend you to not specify its version on your own.
Spring Boot dependencies: https://github.com/spring-projects/spring-boot/blob/v1.3.6.RELEASE/spring-boot-dependencies/pom.xml
Spring Boot Starter reference: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-starters/README.adoc

Annotation Definations:

Stereotype Annotation: Provides hints for people reading the code, and for Spring, that the class plays a specific role.

<
Annotation Defination
@Controller Spring will consider this class when handling incoming web requests.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值