SpringBoot學習一

使用eclipse新建項目的步驟:
1. File –>Spring Starter Project
在next的New Spring Starter Project Dependencies過程中需要注意兩個地方
Available選擇 Web
Spring Boot Version的版本選擇要注意,目前 2.0.4版本尚沒有完全支持,使用較多的還是1.5.8這個版本,該版本如果選擇不好,會導致
org.apache.maven.archiver.MavenArchiver.getManifest
這樣的報錯問題。

  1. 上面第一步完成之後,需要在pom.xml增加以下的代碼,該代碼是修改代碼過程中自動更新到工程應用中,如沒添加需要每次重新運行application修改才能起作用。


    org.springframework.boot
    spring-boot-starter-test
    test

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!-- 開發者工具,當classpath下有文件更新自動觸發應用重啓 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章