pm依赖web
spring-boot-starter:Spring Boot核心Starter,包含自动配置、日志、yaml配置文件的支持
spring-boot-starter-amqb:使用spring-rabbit来支持AMQP
spring-boot-starter-web:支持全栈web开发,里面包括了Tomcat和Spring-webmvc。
spring-boot-starter-data-jpa:对JPA的支持,包含spring-data-jpa、spring-orm和Hibernate
spring-boot-starter-thymeleaf:对Thymeleaf模版引擎的支持,包含于Spring整合的配置
spring-boot-starter-ws: 提供对Spring Web Services的支持
spring-boot-starter-cloud-connectors:对云平台(Cloud Foundry、Heroku)提供的服务简化链接方式
spring-boot-starter-test:提供对经常使用测试框架的支持,包括JUnit,Hamcrest以及Mockito等。
spring-boot-starter-actuator:支持产品环境下的一些功能,好比管理应用、指标度量及监控等。
spring-boot-starter-jetty:支持jetty容器。
spring-boot-starter-log4j:引入默认的log框架(logback)spring
开发标准web项目,pom文件配置以下apache
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- spring boot基本环境 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.1.RELEASE</version>
</parent>
<groupId>spring.boot</groupId>
<artifactId>cloud-simple-helloword</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>cloud-simple-helloword</name>
<dependencies>
<!--web应用基本环境配置 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>mvc
编写你的用户请求入口类,即咱们写的controller类负载均衡
须要加上注解生效 @RestController框架
启动执行器注解@SpringBootApplication 集成了@Configuration、@EnableAutoConfiguration、@EnableWebMvc、@ComponentScan四个注解的功能。maven
spring cloud pom依赖spring-boot