IDEA下gradle创建springboot项目
来源:互联网 发布:python 进程 编辑:程序博客网 时间:2024/05/18 18:47
环境
1.jdk1.5以上
2.interlijidea 15 以上
步骤
1.File –>new –>Project 选择Spring Initialzr 选项 点击Next 进入下一步
2. 选择Type 为Gradle project 表示为gradle 项目 点击next
创建项目名字,以及项目存放的地址,点击Finish
选择对应的gradle 配置,点击ok 这样springboot的项目就创建好了。
问题
如果gradle插件下载依赖包,可能会有依赖包下不下来的问题,或者会有下载包很慢的问题。
此时可以修改需要修改下gradle所默认的maven仓库。
一个简单的办法,修改项目根目录下的build.gradle,将jcenter()或者mavenCentral()替换掉即可:
1
2
3
4
5
allprojects {
repositories {
maven{ url
'https://maven.oschina.net/content/groups/public/'
}
}
}
但是架不住项目多,难不成每个都改一遍么?
自然是有省事的办法,将下面这段Copy到名为init.gradle文件中,并保存到 USER_HOME/.gradle/文件夹下即可。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
allprojects{
repositories {
def REPOSITORY_URL =
'https://maven.oschina.net/content/groups/public'
all
{ ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith(
'https://repo1.maven.org/maven2'
) || url.startsWith(
'https://jcenter.bintray.com/'
)) {
project.logger.lifecycle
"Repository ${repo.url} replaced by $REPOSITORY_URL."
remove repo
}
}
}
maven {
url REPOSITORY_URL
}
}
}
目前国内的maven仓库的镜像有:
1、https://mirrors.ibiblio.org/pub/mirrors/maven2/
2、https://repository.jboss.org/nexus/content/groups/public
3、https://uk.maven.org/maven2/
4、https://maven.net.cn/content/groups/public
5、https://maven.oschina.net/content/groups/public/
阅读全文
0 0
- idea 下gradle创建springboot 项目
- IDEA下gradle创建springboot项目
- idea+springboot+gradle创建项目
- IDEA下创建Springboot,thymeleaf,Mybatis,Postgresql,Gradle项目
- IDEA下创建Springboot,freemarker,mockserver,Gradle项目
- 使用IDEA+GRADLE创建springboot项目
- 使用idea+gradle创建springboot项目
- Gradle创建springboot项目
- idea创建springboot项目
- idea+springboot创建项目
- [SpringBoot学习]-IDEA创建Gradle多Module结构的SpringBoot项目
- 使用gradle 创建springboot项目
- IDEA SpringBoot gradle打项目jar包
- 使用IDEA创建SpringBoot项目
- idea中创建springboot项目
- 使用idea创建SpringBoot项目
- 使用idea创建springboot项目
- springBoot系列-IDEA 创建springBoot项目
- phpcms-v9开启调试模式
- LeetCode118. Pascal's Triangle
- 微信授权和测试整理
- 复制(副本集)
- C++学习-构造函数、析构函数与虚函数的关系
- IDEA下gradle创建springboot项目
- Mysql JDBC Url参数说明useUnicode=true&characterEncoding=UTF-8
- 【phpcms-v9】前台content模块中pc标签的调用说明
- UTF-8、UTF-16、UTF-32编码的相互转换
- 移动端 响应式 img 不失真
- Cordova真机测试之GapDebug
- APP获取手机验证码防止短信轰炸解决办法
- 区分了解MVP, MVC, MVVM
- SpringMVC接收列表数据集合或表格数据集合写法