Home | 简体中文 | 繁体中文 | 杂文 | 知乎专栏 | Github | OSChina 博客 | 云社区 | 云栖社区 | Facebook | Linkedin | 视频教程 | 打赏(Donations) | About
知乎专栏多维度架构

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()
    }
}