參考鏈接
https://blog.csdn.net/HUandroid/article/details/108594243
http://www.itdecent.cn/p/c086de5e4775
1.下載nexus
https://www.sonatype.com/download-oss-sonatype
解壓之后,進入bin目錄,./nexus start 或者 ./nexus run 啟動nexus,
然后在瀏覽器輸入以下
http://127.0.0.1:8081/或者localhost:8081可以進入nexus的操作界面了。
建議使用google瀏覽器打開,部分瀏覽器打不開
首次登陸密碼位置
/Users/apppp/Documents/nexus-mac/nexus-3.26.0-04-mac/sonatypework/nexus3/admin.password
上傳到 nexus 私服
build.gradle 根節(jié)點中添加 類似如下
//maven上傳
uploadArchives {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: 'http://172.25.36.202:8081/repository/maven-releases/') {
authentication(userName: 'admin', password: '445106774')
}
snapshotRepository(url: 'http://172.25.36.202:8081/repository/maven-snapshots/') {
authentication(userName: 'admin', password: '445106774')
}
pom.project {
// version '1.0.1'
version "1.1.1-SNAPSHOT"
artifactId 'module-message-facade'
groupId 'com.zjl.app'
packaging 'aar'
description ''
}
}
}
Android Studio 中打開右側的 Gradle 側邊欄,打開 nexuslibrary,可以看到 uploadArchives,這就是剛才創(chuàng)建的上傳 Task,點擊即可完成上傳。