Android Https Library库or项目发布到JitPack经历
1.首先准备好自己要发布的项目
2.在项目中增加配置(本人就是配置没弄好,花费了挺久的时间在上面)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
//添加jitpack依赖
1.classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
//配置 JitPack 插件的仓库地址
maven { url "https://jitpack.io" }
}
}
上面1有对应的版本如下(或者打开这里查找对应版本)
在app下面的build.gradle中增加下面配置
//启用Jitpack 插件 apply plugin: 'com.github.dcendents.android-maven'
//user为你的github用户名 group='com.github.user' 作者本人填的是 group='com.github.dingqiqi'
3准备工作已经结束,现在上传到GitHub上
git命令行下执行命令时候会报错:
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing
fatal: unable to access: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
这是因为github禁用 TLSv1 和 TLSv1.1导致的,小伙子不用慌
升级git到最新版本就可以 地址:https://gitforwindows.org/
本人上传的项目:https://github.com/dingqiqi/HttpsUtil
4.新建Release版本


下面到了激动人心的时刻了
5.这时候打开JitPack官网
打开新世界的大门:https://jitpack.io/
本人输入https://github.com/dingqiqi/HttpsUtil,点击lookup,项目中对应的release的版本就列出来了
点击get it,开始编译下图编译中
下图编译成功(出现绿色的按钮代表编译成功)
点击绿色的get it,下面就会出现引用的相应配置
最后,本人的Https忽略校验及双向认证库就上传成功了
最后推荐下自己的Https库:https://github.com/dingqiqi/HttpsUtil
引用方式:
allprojects {
repositories {
google()
jcenter()
//配置 JitPack 插件的仓库地址
maven { url "https://jitpack.io" }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.dingqiqi:HttpsUtil:v1.4'
}