Spring Cloud 2.1 搭建Spring Cloud

1.开发环境:

1. JDK 1.8

2. IntelliJ IDEA 

2.开发步骤:

1. IDEA 中 新建Maven项目

2. pom.xml 添加依赖 spring-boot-starter-web

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<version>1.5.4.RELEASE</version>
		</dependency>
	</dependencies>

3. 编写启动类

@SpringBootApplication
@ComponentScan
public class MyApplication {

	public static void main(String[] args) {
		SpringApplication.run(MyApplication.class, args);
	}

}

4. 启动 MyApplication.java 即启动了Spring Cloud 项目

5. 验证

3.源码:

项目源码路径:02/env-test

Spring Cloud 全部源码 百度云:https://pan.baidu.com/s/1pTQC-MXDAoHqv0BU79uyaw

 

 

猜你喜欢

转载自blog.csdn.net/ladymorgana/article/details/81325530