1. 進入Sonatype官網下載nexusandroid
2. 安裝完成app
3. 在服務上建立新用戶和庫com.xxx.yyymaven
4. 在android studio的工程中配置gradle
allprojects { repositories { jcenter() mavenLocal() // 新加 } }
apply plugin: 'maven'
uploadArchives { repositories.mavenDeployer { repository(url:"http://127.0.0.1:8081/repository/com.xxx.yyy/") { authentication(userName:"xxx", password:"xxx") } pom.version="0.0.1" pom.artifactId="my-lib" pom.groupId="com.xxx" } }
5. AS右側選擇gradle打開窗口,雙擊module下的uploadArchives進行上傳。url
6. 在另外一個工程中的gradle中添加it
repositories { maven { url "http://127.0.0.1:8081/repository/com.xxx.yyy/" } }
7. 加入io
compile 'com.xxx:my-lib:0.0.1'
8. 構建工程,這樣aar就順利導入了。module