Android Studio 把自己写的Lib发布到Jcenter
第一步:注册帐号
注册帐号地址:
https://bintray.com/signup/oss

第二步:创建仓库


第三步:获取bintray帐号Key


第四步:配置gradle
打开根目录的gradle

打开lib的gradle


task javadoc(type: Javadoc) {
options {
encoding"UTF-8"
charSet'UTF-8'
authortrue
versiontrue
links"http://docs.oracle.com/javase/7/docs/api"
}
}
//添加
publish {
userOrg ='lostdeer'//bintray.com用户名
groupId ='com.mengcb'//jcenter上的路径
artifactId ='basenetlib'//项目名称
publishVersion ='1.0.2'//版本号
desc ='Oh hi, this is a nice description for a project, right?'//描述,不重要
website ='https://github.com/LostDeer/basenetlib'//网站,不重要;尽量模拟github上的地址,例如我这样的;当然你有地址最好了
}
第五步:打开终端

gradlew clean build bintrayUpload -PbintrayUser=用户名 -PbintrayKey=上面拿到的Key -PdryRun=false(false为真实提交,true不会真实提交)

第六步:同步到jcenter





网友评论
第四步的“jcenter上的路径”是自己随便写的吗,还是可以在哪查看复制的
第六步的“把库的packageid”复制过来,packageid在哪里查看呀