jcenter

作者: pure粹 | 来源:发表于2019-03-15 14:27 被阅读0次

方式一:
项目build.gradle:
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
//最好加上全局编码设置
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
模块build.gradle:
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "0.1.1"//定义版本标识

def siteUrl = 'https://github.com/HouXiaohu/Android-UIAlertView' // #CONFIG# // project homepage
def gitUrl = 'https://github.com/HouXiaohu/Android-UIAlertView.git' // #CONFIG# // project git
group = "com.hxh.component.ui"

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
description 'A View control with a high profile IOS Alert'
name 'androidUiAlertView' // 可默认,项目描述
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer { // 可默认,开发者信息
id 'YOUR_ID'
name 'YOUR NAME'
email 'YOUR EMAIL'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
}

task androidJavadocsJar(type: Jar) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar

}
Properties properties = new Properties()
// 加载本地配置
properties.load(project.rootProject.file('local.properties').newDataInputStream())
//这个是和你bintray上面创建的package(项目)是对应的
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
name = "uialertview" //需更改,这个名字就是你在Bintray上创建Package的名字,这里会查询,如果此包不存在就会创建一个。
userOrg = '*****' //组织名称 organization
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}

最后,在命令行 先执行 gradlew install ,然后执行 gradlew bintrayUpload
到网站上,点进自己的项目,然后,点击
add to Jcenter

https://blog.csdn.net/yufumatou/article/details/80376788

相关文章

网友评论

      本文标题:jcenter

      本文链接:https://www.haomeiwen.com/subject/xqglmqtx.html