spring boot 简单启动

1.在父工程中引用

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

然后在当前项目里面应用
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

然后写一个Application类,在类注解
@SpringBootApplication ,然后在main方法里面
SpringApplication.run(Application.class);
就可以直接运行main方法。浏览器localhost:8080就可以了。
posted @ 2018-01-17 17:30  tangw  阅读(72)  评论(0)    收藏  举报