久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

瀏覽:2日期:2023-09-20 17:37:25
目錄1、配置 IDEA 的 Maven 環(huán)境2、安裝 Spring Assistant 插件3、創(chuàng)建 Spring Cloud 項目1、配置 IDEA 的 Maven 環(huán)境

單擊菜單欄中的 File → Settings → Build, Execution, Deployment → Build Tools → Maven 菜單,在彈出的設(shè)置窗口中設(shè)置 Maven 路徑信息,如下圖:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

2、安裝 Spring Assistant 插件

創(chuàng)建 Spring Cloud(Spring Boot)有兩種方式,這里使用 Spring Assistant 插件創(chuàng)建項目。

(1)啟動 IDEA,單擊菜單欄中的 File → Settings → plugins 菜單。

(2)進(jìn)入界面,在搜索框中輸入關(guān)鍵字 “Spring Assistant”,然后按 Enter 鍵,會搜索到 Spring Assistant(Spring 助理)。在 Spring Assistant 的下方點擊 “Install” 按鈕即可完成安裝。如下圖:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(3)重啟 IDEA 后即可使用。

3、創(chuàng)建 Spring Cloud 項目

下面以創(chuàng)建 Spring Cloud 項目中的基于 Consul 的“服務(wù)提供者”為例。

(1)打開 IDEA 開發(fā)工具后,選擇菜單:File → New → Project。

在左邊欄中選擇 Spring Assistant,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(2)輸入項目相關(guān)信息,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(3)創(chuàng)建基于 Consul 的“服務(wù)提供者”,選擇項如下圖,點擊 “Next” 按鈕。

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

(4)項目創(chuàng)建完成,項目結(jié)構(gòu)圖如下:

IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目

打開 pom.xml 文件內(nèi)容如下:

<?xml version='1.0' encoding='UTF-8'?><project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd'><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.1</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.pjb</groupId><artifactId>provider</artifactId><version>0.0.1-SNAPSHOT</version><name>Provider</name><description>Demo project for Spring Boot</description><properties><java.version>11</java.version><spring-cloud.version>2020.0.3</spring-cloud.version></properties><dependencies> <!-- Spring Cloud Consul 的依賴 --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-consul-discovery</artifactId></dependency> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring-cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement> <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build> </project>

從 pom.xml 文件中可以看出,Consul 的依賴已經(jīng)自動添加。

以上就是IDEA使用SpringAssistant插件創(chuàng)建SpringCloud項目的詳細(xì)內(nèi)容,更多關(guān)于IDEA創(chuàng)建SpringCloud項目的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 阿勒泰市| 晋江市| 阿拉善左旗| 西宁市| 宜兰县| 永胜县| 班玛县| 安宁市| 神农架林区| 蓝山县| 安吉县| 新疆| 漳浦县| 绿春县| 吉安市| 柯坪县| 惠州市| 鄯善县| 舒兰市| 临清市| 甘谷县| 和静县| 论坛| 林口县| 平阴县| 临清市| 南溪县| 平武县| 曲靖市| 绵阳市| 翁源县| 县级市| 荔浦县| 思南县| 武陟县| 闵行区| 吉木乃县| 砚山县| 江西省| 台东市| 博白县|