使用Spring Initializr新建項目
成都創(chuàng)新互聯(lián)公司長期為超過千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為淮濱企業(yè)提供專業(yè)的成都網(wǎng)站建設(shè)、做網(wǎng)站,淮濱網(wǎng)站改版等技術(shù)服務(wù)。擁有十載豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。新建一個Spring Boot項目,推薦使用Spring Initializr的方式。以該方式創(chuàng)建項目需要連接網(wǎng)絡(luò),它會自動查詢Spring Boot的當(dāng)前版本和組件列表。
1.在idea界面,依次點(diǎn)擊左上角菜單欄File-->New-->Project。選擇Spring Initialize,Project SDK選擇1.8,點(diǎn)擊Next。
2.輸入GroupId、ArtifactId,點(diǎn)擊Next。
3.勾選Web,點(diǎn)擊Next。
4.輸入項目名稱、項目地址,點(diǎn)擊Finish.
此時已經(jīng)創(chuàng)建了Spring Boot項目,并且包含了示例程序,點(diǎn)擊右上角的運(yùn)行按鈕就可以了運(yùn)行項目了。
使用Maven新建項目
1.在idea界面,依次點(diǎn)擊左上角菜單欄File-->New-->Project。選擇Maven,Project SDK選擇1.8,點(diǎn)擊Next。
2.輸入GroupId和ArtifactId,點(diǎn)擊Next。
其中GroupId一般由域+公司組成,域又分為org、com、cn等。
3.輸入項目名稱、項目地址,點(diǎn)擊Finish.
這樣就創(chuàng)建了一個項目,接下來在項目下的pom.xml文件中引入spring-boot的相關(guān)jar就可以了。
完整pom.xml文件
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>demo</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
分享題目:在idea中創(chuàng)建SpringBoot項目-創(chuàng)新互聯(lián)
網(wǎng)頁鏈接:http://vcdvsql.cn/article12/cedddc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)、企業(yè)網(wǎng)站制作、App設(shè)計、ChatGPT、用戶體驗(yàn)、搜索引擎優(yōu)化
聲明:本網(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)
猜你還喜歡下面的內(nèi)容