eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

這篇文章主要介紹了eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些的相關(guān)知識,內(nèi)容詳細(xì)易懂,操作簡單快捷,具有一定借鑒價值,相信大家閱讀完這篇eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些文章都會有所收獲,下面我們一起來看看吧。

創(chuàng)新互聯(lián)專注于山陽網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供山陽營銷型網(wǎng)站建設(shè),山陽網(wǎng)站制作、山陽網(wǎng)頁設(shè)計、山陽網(wǎng)站官網(wǎng)定制、微信小程序開發(fā)服務(wù),打造山陽網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供山陽網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

方法一

安裝STS插件

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

安裝插件導(dǎo)向窗口完成后,在eclipse右下角將會出現(xiàn)安裝插件的進(jìn)度,等插件安裝完成后重啟eclipse生效

新建spring boot項(xiàng)目

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

項(xiàng)目啟動

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

方法二

1.創(chuàng)建Maven項(xiàng)目

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

2.選擇項(xiàng)目類型

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

3.選擇項(xiàng)目

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

4.編寫項(xiàng)目組和名稱-finish即可

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

5.修改pom.xml文件

<!-- spring boot基本環(huán)境 -->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
</parent>

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

6.pom.xml中添加依賴

<!--web應(yīng)用基本環(huán)境配置 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

7.pom.xml中添加編譯插件

<build>
    <plugins>
    <!-- spring-boot-maven-plugin插件就是打包spring boot應(yīng)用的 -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins
</build>

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

8.基礎(chǔ)包和類

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

9.創(chuàng)建resources文件夾和application.properties文件

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

10.App.java

package com.springboot.springbootDemo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class App
{
    public static void main( String[] args )
    {
        SpringApplication.run(App.class, args);
    }
}

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

11.HelloController.java

package com.springboot.springbootDemo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("hello2")
public class HelloController {
       @RequestMapping("")
       public String hello() {
              return "helloworld2";
       }
}

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

12.啟動項(xiàng)目

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

13.訪問項(xiàng)目(低版本可能無法訪問,2版本可用)

http://localhost:8012/hello2

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

方法三

訪問http://start.spring.io/

eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些

點(diǎn)擊Generate Project下載項(xiàng)目壓縮包

解壓后,使用eclipse,Import -> Existing Maven Projects -> Next ->選擇解壓后的文件夾-> Finsh,OK done!

關(guān)于“eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對“eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些”知識都有一定的了解,大家如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

本文標(biāo)題:eclipse創(chuàng)建springboot項(xiàng)目的方式有哪些
網(wǎng)頁網(wǎng)址:http://www.muchs.cn/article24/jiopje.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)、網(wǎng)站制作響應(yīng)式網(wǎng)站、商城網(wǎng)站、靜態(tài)網(wǎng)站、App設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營