解决内部环境或企业内网环境问题,经常访问Maven仓库比较困难,此时可以设置Gradle仓库仓库。
1)在用户目录新建一个 .gradle文件夹,某些 我的机器登录 帐户是lwx48xxxx,那么具体路径为 C: Users lwx48xxxx .gradle;
2)在这个目录下新建一个init.gradle文件添加以下内容
- allprojects {
- buildscript {
- 存储库{
- mavenLocal()
- maven { url'http://mirrors.tools.huawei.com/maven/ '}}
- maven {
- //内网JetBrains仓库,下载依赖的IDE和jdk等,用于编译和运行插件url'http://artifactory.cde.huawei.com/artifactory/jetbrains-public/
- '
- }
- maven {url“ http://artifactory.cde.huawei.com/artifactory/gradle-plugins/”}
- maven { url“ http://artifactory.cde.huawei.com/artifactory/maven-public/”}
- maven {url“ http://artifactory.cde.huawei.com/artifactory/huawei-gradlebuild/”}
-
- }
-
- 依赖项{
- // gradle-intellij-plugin用于构建JetBrains插件
- //请确保始终升级到最新版本
- // http://artifactory.cde.huawei.com/artifactory/maven-public/org/jetbrains/intellij/org.jetbrains.intellij.gradle.plugin/
- //类路径“ gradle .plugin.org.jetbrains.intellij.plugins:gradle-intellij-plugin“
- }
- }
- 存储库{
- mavenLocal()
- maven { url'http://mirrors.tools.huawei.com/maven/ '}
- maven {
- //内网JetBrains仓库,下载依赖的IDE和jdk等,用于编译和运行插件 URL'http://artifactory.cde.huawei.com/artifactory/jetbrains-public/
- '
- }
- maven {url“ http://artifactory.cde .huawei.com / artifactory / gradle-plugins /“}
- maven {url“ http://artifactory.cde.huawei.com/artifactory/maven-public/”}
- maven {url“ http://artifactory.cde.huawei.com/artifactory/huawei-gradlebuild/”}
-
- }
- }
- settingsEvaluated {设置->
- settings.pluginManagement {
- 插件{
- }
- resolutionStrategy {
- }
- 存储库{
- maven {url“ http://artifactory.cde.huawei.com/artifactory/gradle-plugins/”}
- }
- }
- }
复制代码