構建Springboot項目的3種方式


一、自己創建:

  1.創建maven項目

  2.pom.xml添加如下內容:

<!--1.指定依賴都由springboot管理-->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.2.RELEASE</version>
    </parent>
    <!--  。。。 -->
    
<dependencies>
    <!--2.添加需要用到的依賴-->
    <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter</artifactId>
    </dependency>
</dependencies>

  3.創建springboot項目啟動類:

@SpringBootApplication
public class MyApplication {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(MyApplication.class);
        app.run(args);
    }
}

二、Web下載基礎項目包

  1.進入spring官網下載springboot項目包:http://https://start.spring.io/

  2.選擇需要的配置后下載:

 

   3.下載后解壓,在編譯器里導入maven項目即可

三、sts工具創建:(spring tool suit)

  1.下載並安裝spring tool suit :https://spring.io/tools3/sts/all  (sts是一個定制版的Eclipse,專為Spring開發定制的,方便創建調試運行維護Spring應用。

  2.選擇配置並創建項目:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM