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;