這篇文章將為大家詳細講解有關使用eclipse如何實現(xiàn)新建一個spirngboot項目,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。

創(chuàng)新互聯(lián)是一家專注于網(wǎng)站建設、成都網(wǎng)站制作與策劃設計,荔城網(wǎng)站建設哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設十年,網(wǎng)設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:荔城等地區(qū)。荔城做網(wǎng)站價格咨詢:18982081108
分享兩種eclipse創(chuàng)建spirngboot項目的辦法:
方案一:創(chuàng)建maven項目后修改pom文件
1.用eclipse創(chuàng)建簡單的maven項目
2.修改pom文件
<?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.chry</groupId>
<artifactId>studySpringBoot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>1.7</java.version>
</properties>
<!-- Inherit defaults from Spring Boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<!-- Package as an executable jar -->
<build>
<finalName>studySpringBoot</finalName>
</build>
</project>3.新建一個類文件
package com.chry.study;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}說明:
1.spring-boot-starter-parent:
springboot官方推薦的maven管理工具,最簡單的做法就是繼承它。 spring-boot-starter-parent包含了以下信息:
2.spring-boot-starter-web
springboot內(nèi)嵌的WEB容器, 缺省會使用tomcat
方案二:在eclipse上安裝STS插件
1、Help -> Eclipse Marketplace
Search或選擇“Popular”標簽,選擇Spring Tool Suite (STS) for Eclipse插件,安裝 或者谷歌百度搜索
2、new project -> 輸入spring 下面會有提示 選擇Spring Starter Project
關于使用eclipse如何實現(xiàn)新建一個spirngboot項目就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
網(wǎng)站欄目:使用eclipse如何實現(xiàn)新建一個spirngboot項目
URL網(wǎng)址:http://www.chinadenli.net/article36/igjipg.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設、品牌網(wǎng)站設計、響應式網(wǎng)站、靜態(tài)網(wǎng)站、微信小程序、云服務器
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)