All Projects → CarGuo → Publishtojcenter

CarGuo / Publishtojcenter

快速集成发布lib到jcenter的例子,针对新版本的brintray,让你的库可以更简单的发布到jcenter

Projects that are alternatives of or similar to Publishtojcenter

Telegrambots
Java library to create bots using Telegram Bots API
Stars: ✭ 2,728 (+8993.33%)
Mutual labels:  jitpack
Image-Slider-View
Slider is android library, which makes you bit more attractive for sliding images. It will be useful for displaying movie casting and crew pics, on-boarding pages etc.
Stars: ✭ 23 (-23.33%)
Mutual labels:  jitpack
KASocialLogins
This is Social login library in which you can login through Facebook , LinkedIn and Google
Stars: ✭ 15 (-50%)
Mutual labels:  jitpack
jitci
A CI with tests, coverage, dependency audit, license & vuln. checks
Stars: ✭ 17 (-43.33%)
Mutual labels:  jitpack
SSJetpackComposeSwipeableView
SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views. You can use this in your lazyColumns or can add a simple view which contains swipe to edit/delete functionality.
Stars: ✭ 57 (+90%)
Mutual labels:  jitpack
jcenter-config
Painlessly publish your library/project to jcenter() with these simple scripts.
Stars: ✭ 13 (-56.67%)
Mutual labels:  jitpack
Jitpack.io
Documentation and issues of https://jitpack.io
Stars: ✭ 2,156 (+7086.67%)
Mutual labels:  jitpack
Material Drawer
Custom drawer implementation for Material design apps.
Stars: ✭ 611 (+1936.67%)
Mutual labels:  jitpack
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (+106.67%)
Mutual labels:  jitpack
StuyLib
Award-Winning FRC Library by StuyPulse Team 694
Stars: ✭ 17 (-43.33%)
Mutual labels:  jitpack
kotlogram2
An convinient wrapper for kotlogram
Stars: ✭ 17 (-43.33%)
Mutual labels:  jitpack
wallhaven4j
Wallhaven API for Java
Stars: ✭ 17 (-43.33%)
Mutual labels:  jitpack
Trialer
A small and simple library for managing trial period in your android app.
Stars: ✭ 44 (+46.67%)
Mutual labels:  jitpack
RedirectStorage
针对第三方 SDK 乱改存储卡和读取用户数据等行为,利用反射方式重定向 SD 卡目录。
Stars: ✭ 47 (+56.67%)
Mutual labels:  jitpack
Pudding
🌟 Pudding use WindowManager(don't need request permission) to pull down a view that are displayed on top their attached window
Stars: ✭ 371 (+1136.67%)
Mutual labels:  jitpack
Diffadapter
A high-performance , easy-to-use Adapter for RecyclerView ,using diffutil
Stars: ✭ 193 (+543.33%)
Mutual labels:  jitpack
ProminentColor
Android Library to get average/prominent color of bitmap/drawable
Stars: ✭ 23 (-23.33%)
Mutual labels:  jitpack
Justweengine
An easy open source Android Native Game FrameWork.
Stars: ✭ 762 (+2440%)
Mutual labels:  jitpack
Material Viewpagerindicator
Dot-based Android ViewPager indicator with Material Design animations.
Stars: ✭ 511 (+1603.33%)
Mutual labels:  jitpack
PassCodeText
A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customizability.
Stars: ✭ 105 (+250%)
Mutual labels:  jitpack

PublishToJcenter

发布到jcenter路过各种坑,尝试了各个大神的文章一直跑步起来,这里综合一下

##主要是针对新版本的bintray,发布Android的lib发布Jcenter,需要的Gradle脚本及属性文件.

bintray.gradle: 用于发布到JCenter的脚本。

build.gradle: project下的脚本

gradle.properties: 在bintray.gradle对应的属性,新版本增加了组织的概念

lib/build.gradle: 针对需要发布的model,其中切记

apply from: '../bintray.gradle'一定要写在最后面<\h5>

###1. 注册保存bintray

bintray的地址:https://bintray.com/ ,注册时候qq邮箱和163邮箱注册不了,微软的live邮箱和新浪邮箱可以注册。

网上大多数文章都说进入后会有一个API Key,但是我在edit profile一直没找到,直达后来创建了maven之后才发现。

记住账号名以及API Key是bintray上传必须的。

目前我是放在了项目的gradle.properties下,需要的时候就填写了发布,配置了一个ignore的文件不会上传,要用就复制过去,各位如果有更好的办法可以提供下

BINTRAY_USER=bintray account name
BINTRAY_KEY=bintray API Key

###2. project目录下的build.gradle文件,对应build.gradle 主要添加这个依赖

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
    }
}

###3. 在lib的这个build.gradle底部添加以下代码:    (一定要在底部,對應build.gradle 主要添加这个依赖) apply from: './bintray.gradle'

###34.根目录下的gradle.properties

接下来对内容进行配置,下面是一个例子:

# <dependency>
#   <groupId>com.shuyu</groupId>
#   <artifactId>bbb</artifactId>
#   <version>1.0.0</version>
#   <type>pom</type>
# </dependency>

BINTRAY_USER= 你在bintray上的账号名
BINTRAY_KEY=  你在bintray上的API KEY
PROJ_USER_ORG=你在bintray上的组织名字
PROJ_USER_MAVEN=你在bintray上的repo名字
PROJ_NAME=你在bintray上的repo名字下的包名

PROJ_GROUP= 这是上的groupId,自己配置
PROJ_VERSION=这是上面的version,自己配置
PROJ_ARTIFACTID=上面的artifactId

PROJ_WEBSITEURL=github上的url就好了,可以不填
PROJ_ISSUETRACKERURL=可以不填
PROJ_VCSURL=github上的ssh就好了,可以不填
PROJ_DESCRIPTION=描述,可以不填


DEVELOPER_ID=发布人id,自己填
DEVELOPER_NAME=发布人名字,自己填
DEVELOPER_EMAIL=发布人邮箱,自己填

上面的例子最终在Android Studio中的引用形式为:

dependencies {
    compile 'com.shuyu:bbb:1.0.0'
}

它的格式是 PROJ_GROUP:PROJ_ARTIFACTID:PROJ_VERSION组成。

###4. 执行发布命令 执行 gradlew bintrayUpload 将库发布到 bintray.com.

gradlew bintrayUpload

###5. 将库加入Jcenter 最后一步,需要登录bintray.com,将我们刚刚发布的库申请加入到jcenter,这样别人才能直接引用到。

###6、 备注与问题 bintray上的创建:

  • 这里可以找到你的api key

  • 你需要先创建repo,不然会出现404找不到package,其中name可以根据你的喜欢来填写,后面对应配置到上面gradle.properties的的PROJ_USER_MAVEN

  • 你还需要再改repo下创建包,不然会出现404找不到package,主要添加name,后面对应配置到上面gradle.properties的PROJ_NAME

  • 新版本有组织的概念,这个就是组织id,后面对应配置到上面gradle.properties的PROJ_USER_ORG

  • 一般出现401,400,404的基本都是没有创建好repo和package,还有就是groupId不对,最后就是username和apikey正确就好了

##参考自

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].