maven库上传

账号申请

    1. bintray 申请账号。
  • 2.新建一个名称为:maven 的maven库。

    1. 新建 Android Studio 项目,新建要上传的Module模块。
    1. 根目录(项目所在)下的 build.gradle中添加库引用
buildscript {

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.novoda:bintray-release:0.7.0'  // a.novoda引用
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
    tasks.withType(Javadoc) {
        options.addStringOption('Xdoclint:none', '-quiet') //忽略javadoc错误
        options{
            encoding "UTF-8"
            charSet 'UTF-8'
            links "http://docs.oracle.com/javase/7/docs/api"
        }
    }

}

task clean(type: Delete) {
    delete rootProject.buildDir
}
  • 3.module中build.gradle添加maven配置
apply plugin: 'com.novoda.bintray-release'
//添加
publish {
    userOrg = 'jfson'//bintray.com用户名
    groupId = 'com.jfson'//jcenter上的路径
    artifactId = 'widget'//项目名称
    publishVersion = '1.0.1'//版本号
    desc = 'this is decoupling Decoupling tools'//描述,不重要
    website = 'https://github.com/jfson/widgetcontrol'//网站,不重要;尽量模拟github上的地址,例如我这样的;当然你有地址最好了
}

// 上传脚本
//./gradlew clean build bintrayUpload -PbintrayUser=jfson -PbintrayKey=****** -PdryRun=false

自行替换自己的参数配置、PbintrayUser和PbintrayKey。
* 4.最后在Terminal 中执行上传脚本即可。

添加到maven 库

  • 右下角有个 add jcenter 按钮。大概几个小时就可以了
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值