# StudyMavenLocalLib **Repository Path**: zwl-android-study/StudyMavenLocalLib ## Basic Information - **Project Name**: StudyMavenLocalLib - **Description**: gradle本地仓库学习 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # StudyMavenLocalLib #### 介绍 Artifactory 搭建本地仓库学习 # 安装教程 1、下载并解压 Artifactory 下载链接: https://jfrog.com/open-source/ 注:由此可见 artfactory使用的是自带的tomcat进行搭建服务的,而最新版tomcat依赖jdk 1.8 , 故 1、配置java环境 2、jdk 需要是 1.8 版本 2、 运行 mac :artifactory.sh win:windows双击artifactory.bat 安装成功后: ########################################################### ### Artifactory successfully started (25.662 seconds) ### ########################################################### 3、浏览器访问:http://localhost:8081/artifactory/ 账号:admin 密码:password 4、新建 4.1 admin ->local->新建 android_local 4.2 admin ->Remote-> android_google: https://maven.aliyun.com/repository/google/ android_gradle: https://maven.aliyun.com/repository/gradle-plugin/ android_jcenter: https://maven.aliyun.com/repository/jcenter/ android_public: http://maven.aliyun.com/nexus/content/groups/public/ 4.3 admin ->Virtual android_group 添加 android_google android_gradle: android_jcenter android_public #### 使用说明 1、修改项目中的引用 修改项目 build.gradle buildscript ({ repositories ({ maven { url 'http://localhost:8081/artifactory/android_group/' } // google() // jcenter() }) dependencies { classpath 'com.android.tools.build:gradle:3.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }) allprojects { repositories { maven { url 'http://localhost:8081/artifactory/android_group/' } // google() // jcenter() } } 修改 gradle-》wrapper-》gradle-wrapper.properties 修改: distributionUrl=http\://localhost:8081/artifactory/android_local/gradle-5.4.1-all.zip 2、遇到401问题 解决办法: admin -> Security Configuration-> Allow Anonymous Access 打钩