在ECLIPSE中创建跑得起来的SPRINGBOOT项目 | 您所在的位置:网站首页 › eclipse导入项目怎么跑起来 › 在ECLIPSE中创建跑得起来的SPRINGBOOT项目 |
springboot本质上是一个java程序,采用maven风格,可以按照maven项目的方式创建。 1.创建maven项目 2.网站的pom.xml里面的内容覆盖掉项目里的pom.xml覆盖后,右键点击项目->Maven->Update Project 更新一下项目 4.0.0 com.how2java springboot 0.0.1-SNAPSHOT springboot springboot org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE org.springframework.boot spring-boot-starter-web junit junit 3.8.1 test 1.8 org.springframework.boot spring-boot-maven-plugin3.创建Application.java和HelloController.java package com.how2java.springboot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } package com.how2java.springboot.web; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello") public String hello() { return "Hello Spring Boot!"; } }
|
CopyRight 2018-2019 实验室设备网 版权所有 |