配合 GitHub 創建一個 Spring Boot Project。
- 先進入到 GitHub 的網頁。點擊 New 按扭去新增一個 Repository。
- 輸入名稱、並點擊下方按鈕創建。
- 如果沒有特別去設定 SSH key 的話、就必需得是 https開頭。將此網址複製。
- 開啟 IntelliJ 、點擊右上角的 Get from VCS 。
- 貼上剛剛複製的連結並點擊右下角的 Clone 。
- 先關掉 IntelliJ、進到剛剛 Clone 的資料夾、刪掉 .idea 的隱藏資料夾。
- 回到 IntelliJ 、選擇 New Project 創建和剛剛相同名稱的 Project 、此時會出現警告視窗、直接 Yes 即可。
- 在 Dependencies 這裡、依個人所需選擇。(Spring Web, JDBC API, MS SQL Server DRiver)
- 建立完成後可點擊右下角的 Always Add 、讓 IntelliJ 自動將檔案加到 Git 版本控制下、加好後可看到左邊檔案會變成綠色的狀態。
- 將以下多餘的檔案刪掉。
<!--SQL2008 https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.2.2.jre11</version>
</dependency>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
- 點選左邊的 Commit 、填入說明、點擊 Commit and Push 進行第一次上傳。
- 回到 GitHub 上檢查、收工。