eclipse中搭建springboot

1.首先安裝springboot快速搭建插件

打開-HELP->Eclipse Marketplace->搜索spring,安裝此插件,重啓eclipse

18094074-d49d953429f5d1da.png
image.png

然後新建springboot項目即可

18094074-697a46ef5a1ae55a.png
image.png

這樣我們就快速搭建了一個簡單版的springboot項目出來。然後我們先運行看看。

package yick.demo.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class })
@SpringBootApplication
@RestController
public class SpringbootDemo1Application {

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

    @GetMapping(value = "hello")
    public String hello() {
        return "Hello,Spring boot";
    }
}

訪問http://localhost:8080/hello,如圖

18094074-bc8872dcbd4d7e7d.png
image.png

大功告成,是不是非常簡單呢。


18094074-c80294f9642e54f1.jpg
有你的支持,我會更努力哦!!!.jpg
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章