-
在bintray注册个人用户,支持github账户登录。 地址
-
登录新账户,点击下图位置,生成自己的仓库,仓库的名字起maven
Paste_Image.png
-
切换到AS,要提交到jcenter中的工程需要是库工程。
-
在project下的gradle中添加依赖
classpath 'com.novoda:bintray-release:0.4.0' -
在module下的gradle中添加插件
apply plugin: 'com.novoda.bintray-release';
添加代码块
publish {
userOrg = 'xxx'//用户名
groupId = 'com.xxx'//用户名
artifactId = 'xxx'//项目名称
publishVersion = '0.0.3'//版本号
desc = 'xxx'//描述
website = 'xxx'//网站,不重要
} -
mac下,AS的Terminal中输入
./gradlew clean build bintrayUpload -PbintrayUser=用户名 -PbintrayKey=API KEY -PdryRun=false
API KEY 可以点击bintray官网
Paste_Image.png
弹出的菜单中选择Edit Profile,然后选择左侧的
Paste_Image.png
获得,如图。
Paste_Image.png
-
当AS中显示
Paste_Image.png
库上传成功。
-
登录bintray点击
Paste_Image.png
选择刚刚上传的库,点击进入,然后点击
Paste_Image.png
将项目添加到JCenter。 -
等几个小时,审核通过。
-
引用。









网友评论