IDEA配置Maven阿里雲映象以及建立SpringBoot專案
IDEA配置Maven阿里雲映象以及建立SpringBoot專案
首先的話 我們配置下maven阿里雲映象,預設映象下載速度比較慢,經常jar包破損;
Build,Execution,Deployment -> Maven
我們不用官方提供的,我們用自己本機的maven;
紅色圈的 分別是 Maven 目錄 ,使用者settings設定 以及本地倉庫地址; 我們都選擇設定下;
這裡的settings,我們要設定下maven阿里雲映象
settings主要有個地方配置:
<localRepository>D:\ideaRepository</localRepository>
本地倉庫地址配置
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
阿里雲映象配置
https://pan.baidu.com/s/1fjkdw7vPKoKCsZzZNVwKVA 分享下settings
Build,Execution,Deployment -> Maven -> Importing
自動匯入maven專案 以及 下載 原始碼 和 文件 方便我們學習;
下面我們新建一個maven專案,直接springboot算了;
新建Module;
Next:
前面學過Springboot,所以不解釋;
選擇Web,Thymeleaf,Jpa
然後Next;
稍等片刻,等Maven把所需要的Jar包下載完,以及專案構建完;
我們新建一個Controller類 測試下;
com.java1234.controllerorg.springframework.web.bind.annotation.org.springframework.web.bind.annotation.() CustomerController { () String (){ } }
執行報錯:
啟動類加個註解:
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
執行 :http://localhost:8080/customer/list
測試OK;