在.gradle目录中,修改init.gradle文件,修改其中的maven地址。
在.m2目录中,修改settings.xml文件,修改其中的maven地址。
以下是init.gradle文件:
allprojects {repositories { def REPOSITORY_URL =
‘http://192.168.1.XX:XXXX/nexus/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.urlreplacedbyREPOSITORY_URL.” remove repo } } } mavenLocal()
maven { url REPOSITORY_URL } } }