Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

2.6. Artifactory

	
	
	
	

2.6.1. Artifactory Web UI

通過訪問 http://localhost:8081/artifactory/ ,用預設管理員賬號密碼(用戶名:admin,密碼:password ) 登錄,進入管理界面體驗 Artifactory。

2.6.2. build.gradle

		
buildscript {
    repositories {

        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/libs-release-local"
        }

        jcenter()
    }
    dependencies {
        ...
    }
}

allprojects {
    repositories {
        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/libs-release-local"
        }

        jcenter()
    }
}
		
		

Artifactory 預設將 jecnter 庫緩存到私有 maven倉庫中。我們可以在項目中配置 jcenter 倉庫信息列表,後續編譯所需要的包都直接從私服 maven倉庫讀取,加快項目編譯速度。

		
buildscript {
    repositories {
        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/jcenter" // 配置私服jcenter倉庫信息
        }

        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/libs-release-local"
        }

        jcenter()
    }
    dependencies {
       ...
    }
}

allprojects {
    repositories {
        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/jcenter" // 配置私服jcenter倉庫信息
        }

        maven {
            url "http://artifactory.netkiller.cn:8081/artifactory/libs-release-local"
        }

        jcenter()
    }
}