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

使用eclipse快速新建spirngboot項(xiàng)目的方法

 更新時(shí)間:2017年04月19日 09:40:46   作者:伶壹  
本篇文章主要介紹了使用eclipse快速新建spirngboot項(xiàng)目的方法,具有一定的參考價(jià)值,有興趣的可以了解一下

分享兩種eclipse創(chuàng)建spirngboot項(xiàng)目的辦法:

方案一:創(chuàng)建maven項(xiàng)目后修改pom文件

1.用eclipse創(chuàng)建簡(jiǎn)單的maven項(xiàng)目

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.新建一個(gè)類文件

 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);
  }
}

說(shuō)明:

1.spring-boot-starter-parent:

springboot官方推薦的maven管理工具,最簡(jiǎn)單的做法就是繼承它。 spring-boot-starter-parent包含了以下信息:

  1. 缺省使用java6編譯, 如果需要改為java 1.7,則在pom中加上java.version屬性即可
  2. 使用utf-8編碼
  3. 實(shí)現(xiàn)了通用的測(cè)試框架 (JUnit, Hamcrest, Mockito).
  4. 智能資源過(guò)濾
  5. 智能的插件配置(exec plugin, surefire, Git commit ID, shade).

2.spring-boot-starter-web

springboot內(nèi)嵌的WEB容器, 缺省會(huì)使用tomcat

方案二:在eclipse上安裝STS插件

1、Help -> Eclipse Marketplace

Search或選擇“Popular”標(biāo)簽,選擇Spring Tool Suite (STS) for Eclipse插件,安裝 或者谷歌百度搜索

2、new project -> 輸入spring 下面會(huì)有提示 選擇Spring Starter Project

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • IDEA創(chuàng)建MyBatis配置文件模板的方法步驟

    IDEA創(chuàng)建MyBatis配置文件模板的方法步驟

    這篇文章主要介紹了IDEA創(chuàng)建MyBatis配置文件模板的方法步驟,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04
  • Java中的ThreadPoolExecutor線程池詳解

    Java中的ThreadPoolExecutor線程池詳解

    這篇文章主要介紹了Java中的ThreadPoolExecutor線程池詳解,當(dāng)線程池中的線程數(shù)大于 corePoolSize 時(shí),keepAliveTime 為多余的空閑線程等待新任務(wù)的最長(zhǎng)時(shí)間,超過(guò)這個(gè)時(shí)間后多余的線程將被終止,需要的朋友可以參考下
    2023-12-12
  • ShardingJdbc讀寫分離的BUG踩坑解決

    ShardingJdbc讀寫分離的BUG踩坑解決

    這篇文章主要為大家介紹了ShardingJdbc讀寫分離的BUG踩坑解決,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-08-08
  • SpringBoot預(yù)防XSS攻擊的實(shí)現(xiàn)

    SpringBoot預(yù)防XSS攻擊的實(shí)現(xiàn)

    XSS攻擊是一種在web應(yīng)用中的計(jì)算機(jī)安全漏洞,它允許惡意web用戶將代碼植入到提供給其它用戶使用的頁(yè)面,本文主要介紹了SpringBoot預(yù)防XSS攻擊的實(shí)現(xiàn),感興趣的可以了解一下
    2023-08-08
  • 謹(jǐn)慎使用Java8的默認(rèn)方法

    謹(jǐn)慎使用Java8的默認(rèn)方法

    為什么要謹(jǐn)慎使用Java8的默認(rèn)方法?本文給出了為什么要慎用Java8默認(rèn)方法的原因,解釋的很詳細(xì),感興趣的朋友可以參考一下
    2016-01-01
  • SpringSecurity OAuth2單點(diǎn)登錄和登出的實(shí)現(xiàn)

    SpringSecurity OAuth2單點(diǎn)登錄和登出的實(shí)現(xiàn)

    本文主要介紹了SpringSecurity OAuth2單點(diǎn)登錄和登出的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-02-02
  • MYSQL批量插入數(shù)據(jù)的實(shí)現(xiàn)代碼

    MYSQL批量插入數(shù)據(jù)的實(shí)現(xiàn)代碼

    非常的實(shí)現(xiàn)原理,代碼較多,建議大家仔細(xì)看看。
    2008-10-10
  • Java中String.format的使用方法總結(jié)

    Java中String.format的使用方法總結(jié)

    這篇文章主要介紹了Java中String.format的用法總結(jié)的相關(guān)資料,需要的朋友可以參考下
    2017-03-03
  • Java實(shí)現(xiàn)辦公文檔在線預(yù)覽功能

    Java實(shí)現(xiàn)辦公文檔在線預(yù)覽功能

    java實(shí)現(xiàn)辦公文件在線預(yù)覽功能是一個(gè)大家在工作中也許會(huì)遇到的需求,這篇文章就教大家如何實(shí)現(xiàn)這一功能,感興趣的小伙伴可以了解一下
    2021-12-12
  • java基于遞歸算法實(shí)現(xiàn)漢諾塔問(wèn)題實(shí)例

    java基于遞歸算法實(shí)現(xiàn)漢諾塔問(wèn)題實(shí)例

    這篇文章主要介紹了java基于遞歸算法實(shí)現(xiàn)漢諾塔問(wèn)題,結(jié)合具體實(shí)例形式分析了java遞歸算法的實(shí)現(xiàn)與使用技巧,需要的朋友可以參考下
    2017-07-07

最新評(píng)論