闲来无事,想起来学习spring-boot,但是网上资料少之又少,现有资料讲得又很粗糙,迫于无奈,只好翻看官方英文版文档了。平时不怎么看英文文档,所以英文单词量较少,借助有道词典的桌面取词功能慢慢看吧,后悔当初没好好背单词了。~~~~(>_<)~~~~
本文不在于讲解spring-boot,仅仅是用来记录自己所看过的文档知识,以便于以后自己翻阅。废话不多说了,开始记录吧。
通过maven创建,pom文件继承于:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.2.RELEASE</version> </parent>
但是并非不是每个人都喜欢继承于这个parent,所以spring-boot提供了另一种依赖方式:
<dependencyManagement> <dependencies> <!-- Override Spring Data release train provided by Spring Boot --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-releasetrain</artifactId> <version>Fowler-SR2</version> <scope>import</scope> <type>pom</type> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.3.2.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
两种方式是一样的效果。
spring-boot默认使用了java1.6版本,如果需要使用更高版本的jdk,则可以添加属性覆盖默认属性:
<properties> <java.version>1.8</java.version> </properties>spring-boot使用了嵌入式web容器,使得web应用可以像普通java应用一样,通过jar包执行,那么我们就需要在packing时为应用生成一个可执行的jar包,spring-boot提供了一个maven插件生成可执行jar:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>spring-boot提供了很多starter,他们的groupId均为org.springframework.boot:
Name | Description |
---|---|
|
The core Spring Boot starter, including auto-configuration support, logging and YAML. |
|
Production ready features to help you monitor and manage your application. |
|
Support for the “Advanced Message Queuing Protocol” via |
|
Support for aspect-oriented programming including |
|
Support for “Java Message Service API” via Apache Artemis. |
|
Support for “Spring Batch” including HSQLDB database. |
|
Support for Spring’s Cache abstraction. |
|
Support for “Spring Cloud Connectors” which simplifies connecting to services in cloud platforms like Cloud Foundry and Heroku. |
|
Support for the Elasticsearch search and analytics engine including |
|
Support for the GemFire distributed data store including |
|
Support for the “Java Persistence API” including |
|
Support for the MongoDB NoSQL Database, including |
|
Support for exposing Spring Data repositories over REST via |
|
Support for the Apache Solr search platform, including |
|
Support for the FreeMarker templating engine. |
|
Support for the Groovy templating engine. |
|
Support for HATEOAS-based RESTful services via |
|
Support for “Java Message Service API” via HornetQ. |
|
Support for common |
|
Support for JDBC databases. |
|
Support for the Jersey RESTful Web Services framework. |
|
Support for JTA distributed transactions via Atomikos. |
|
Support for JTA distributed transactions via Bitronix. |
|
Support for |
|
Support for |
|
Support for the Mustache templating engine. |
|
Support for the REDIS key-value data store, including |
|
Support for |
|
Support for |
|
Support for |
|
Support for |
|
Support for common test dependencies, including JUnit, Hamcrest and Mockito along with
the |
|
Support for the Thymeleaf templating engine, including integration with Spring. |
|
Support for the Velocity templating engine. |
|
Support for full-stack web development, including Tomcat and |
|
Support for WebSocket development. |
|
Support for Spring Web Services. |
好了,今天就写到这里吧,洗洗睡吧,晚安!