How to set global repositories for gradle that I can use them in each gradle project

前端 未结 2 1946
耶瑟儿~
耶瑟儿~ 2021-02-07 10:57

It\'s slow to visit the maven official repositories from my country, so I want to try some local repositories first.

Is it able to add them to some global gradle configu

相关标签:
2条回答
  • 2021-02-07 11:38

    I guess that what are You looking for are init scripts.

    0 讨论(0)
  • 2021-02-07 11:48

    I would suggest to use the init.gradle script which is located in your home folder $HOME/.gradle/init.gradle which might contain the following content:

    allprojects {
        repositories {
            mavenLocal()
            maven {
              url "http://localhost:8081/nexus/content/groups/public/"
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题