|
HarmonyOS初步探索04:使用DevEco Studio時(shí)設(shè)置Gradle倉(cāng)庫(kù)代替, 解決內(nèi)部環(huán)境或企業(yè)內(nèi)網(wǎng)環(huán)境問(wèn)題,經(jīng)常訪問(wèn)Maven倉(cāng)庫(kù)比較困難,此時(shí)可以設(shè)置Gradle倉(cāng)庫(kù)倉(cāng)庫(kù)。
1)在用戶目錄新建一個(gè) .gradle文件夾,某些 我的機(jī)器登錄 帳戶是lwx48xxxx,那么具體路徑為 C:\ Users \ lwx48xxxx \ .gradle;
2)在這個(gè)目錄下新建一個(gè)init.gradle文件添加以下內(nèi)容
- allprojects {
- buildscript {
- 存儲(chǔ)庫(kù){
- mavenLocal()
- maven { url\“http://mirrors.tools.huawei.com/maven/ \“}}
- maven {
- //內(nèi)網(wǎng)JetBrains倉(cāng)庫(kù),下載依賴的IDE和jdk等,用于編譯和運(yùn)行插件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/”}
-
- }
-
- 依賴項(xiàng){
- // gradle-intellij-plugin用于構(gòu)建JetBrains插件
- //請(qǐng)確保始終升級(jí)到最新版本
- // 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“
- }
- }
- 存儲(chǔ)庫(kù){
- mavenLocal()
- maven { url\“http://mirrors.tools.huawei.com/maven/ \“}
- maven {
- //內(nèi)網(wǎng)JetBrains倉(cāng)庫(kù),下載依賴的IDE和jdk等,用于編譯和運(yùn)行插件 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 {設(shè)置->
- settings.pluginManagement {
- 插件{
- }
- resolutionStrategy {
- }
- 存儲(chǔ)庫(kù){
- maven {url“ http://artifactory.cde.huawei.com/artifactory/gradle-plugins/”}
- }
- }
- }
復(fù)制代碼
|
|