欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SpringBoot?IDEA聯(lián)不了網(wǎng)創(chuàng)建項(xiàng)目的3種方式(官網(wǎng)創(chuàng)建版、阿里云版、手工制作版)

 更新時(shí)間:2023年09月13日 11:38:29   作者:梨輕巧  
這篇文章主要介紹了SpringBoot?IDEA聯(lián)不了網(wǎng)創(chuàng)建項(xiàng)目的3種方式,主要包括官網(wǎng)創(chuàng)建版、阿里云版、手工制作版,具有一定的參考價(jià)值,感興趣的可以了解一下

一  官網(wǎng)創(chuàng)建版(IDEA不聯(lián)網(wǎng)版)

適用于:IDEA聯(lián)不了網(wǎng),能上spring官網(wǎng)

1 在spring官網(wǎng)填寫項(xiàng)目信息

打開Spring官網(wǎng):spring.io

Project--spring boot

拖到網(wǎng)頁的下面 -- Spring Initializr

 填寫項(xiàng)目信息,下載文件,解壓縮

注意改一下jdk版本

2 導(dǎo)入模塊

project structure--modules-- + -- import module--選擇剛下載到本地的文件--ok--finish

3 寫控制器

package com.qing.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//rest模式:寫在類上,把類變成控制器
@RestController
//請(qǐng)求的url
@RequestMapping("/books")
public class BookController {
    //請(qǐng)求方式是get
    @GetMapping
    public String getById(){
        System.out.println("console:SpringBoot is running2");
        return "rest:SpringBoot is running2";
    }
}
 

4 運(yùn)行

 如果出現(xiàn)這個(gè)錯(cuò)誤請(qǐng)點(diǎn)這里:Error:java: 無效的源發(fā)行版

總結(jié)

二 阿里云版

https://start.aliyun.com

適用于:IDEA聯(lián)不了網(wǎng),spring的官網(wǎng)也上不去,能上國內(nèi)的網(wǎng)

1 file -- project structure -- + -- new module -- spring initializr --custom:https://start.aliyun.com -- next -- 起模塊名子 -- next -- 選擇項(xiàng)目類型 -- next -- finish -- ok 

java 文件夾上右鍵 -- make directory as -- resources root

pom.xml文件右鍵 -- add as a maven project -- 然后就開始下載依賴

2 復(fù)制controller的代碼過去,運(yùn)行

三 手工制作版

適用于:這臺(tái)電腦曾經(jīng)聯(lián)過網(wǎng),曾經(jīng)啟動(dòng)過maven項(xiàng)目,現(xiàn)在聯(lián)不了網(wǎng)

1 創(chuàng)建模塊

file -- project structure --new module -- 選maven -- next -- 起模塊名字 -- finish -- ok

2 修改pom.xml 文件

從以前的項(xiàng)目復(fù)制<parent> 

從以前的項(xiàng)目復(fù)制<dependencies>

需要復(fù)制的如下代碼:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.0</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
 <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
 </dependencies>

3 刷新maven,寫一個(gè)啟動(dòng)應(yīng)用程序

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

4 復(fù)制controller過去,啟動(dòng)

到此這篇關(guān)于SpringBoot IDEA聯(lián)不了網(wǎng)創(chuàng)建項(xiàng)目的3種方式(官網(wǎng)創(chuàng)建版、阿里云版、手工制作版)的文章就介紹到這了,更多相關(guān)SpringBoot IDEA不聯(lián)網(wǎng)創(chuàng)建項(xiàng)目?jī)?nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • IDEA插件之Mybatis Log plugin 破解及安裝方法

    IDEA插件之Mybatis Log plugin 破解及安裝方法

    這篇文章主要介紹了IDEA插件之Mybatis Log plugin 破解方法及安裝方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-09-09
  • 使用maven構(gòu)建java9 service實(shí)例詳解

    使用maven構(gòu)建java9 service實(shí)例詳解

    本篇文章主要介紹了使用maven構(gòu)建java9 service實(shí)例詳解,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-02-02
  • SpringCloud用Zookeeper搭建配置中心的方法

    SpringCloud用Zookeeper搭建配置中心的方法

    本篇文章主要介紹了SpringCloud用Zookeeper搭建配置中心的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • 關(guān)于jdk環(huán)境變量配置以及javac不是內(nèi)部或外部命令的解決

    關(guān)于jdk環(huán)境變量配置以及javac不是內(nèi)部或外部命令的解決

    這篇文章主要介紹了關(guān)于jdk環(huán)境變量配置以及javac不是內(nèi)部或外部命令的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 如何在Java中使用標(biāo)準(zhǔn)庫創(chuàng)建臨時(shí)文件

    如何在Java中使用標(biāo)準(zhǔn)庫創(chuàng)建臨時(shí)文件

    有時(shí)候我們程序運(yùn)行時(shí)需要產(chǎn)生中間文件,但是這些文件只是臨時(shí)用途,并不做長(zhǎng)久保存,我們可以使用臨時(shí)文件,不需要長(zhǎng)久保存,這篇文章主要給大家介紹了關(guān)于如何在Java中使用標(biāo)準(zhǔn)庫創(chuàng)建臨時(shí)文件的相關(guān)資料,需要的朋友可以參考下
    2023-10-10
  • Python連接Java Socket服務(wù)端的實(shí)現(xiàn)方法

    Python連接Java Socket服務(wù)端的實(shí)現(xiàn)方法

    這篇文章主要介紹了Python連接Java Socket服務(wù)端的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-01-01
  • 最新評(píng)論