代码拉取完成,页面将自动刷新
同步操作将从 miles/easy-okhttp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
//上传到jcenter至少需要四个文件,除了打包的jar之外,
//还需要pom和javadoc,source,否则是通不过jcenter审核的。
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'java'
group GROUP
version VERSION_NAME
//如何解决编译、生成JavaDOC和测试时注释的乱码问题
[compileJava, javadoc, compileTestJava]*.options*.encoding = 'UTF-8'
def getBintrayUserProperty() {
return hasProperty('BINTRAY_USER') ? BINTRAY_USER : ""
}
def getBintrayApiKeyProperty() {
return hasProperty('BINTRAY_APIKEY') ? BINTRAY_APIKEY : ""
}
//根据jcenter的审核要求 必须包含sourceJar和docJar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//上传
publishing {
publications {
mavenJava(MavenPublication) {
//GAV配置
groupId GROUP
artifactId ARTIFACT_ID
version VERSION_NAME
from components.java
artifact sourceJar
artifact javadocJar
//pom相关信息
pom.withXml {
Node root = asNode()
root.appendNode('name', ARTIFACT_ID)
root.appendNode('description', POM_DESCRIPTION)
root.appendNode('url', POM_URL)
def issues = root.appendNode('issueManagement')
issues.appendNode('system', 'github')
issues.appendNode('url', ISSUE_URL)
def scm = root.appendNode('scm')
scm.appendNode('url', POM_SCM_URL)
scm.appendNode('connection', POM_SCM_CONNECTION)
scm.appendNode('developerConnection', POM_SCM_DEV_CONNECTION)
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', POM_LICENCE_NAME)
license.appendNode('url', POM_LICENCE_URL)
license.appendNode('distribution', POM_LICENCE_DIST)
def developer = root.appendNode('developers').appendNode('developer')
developer.appendNode('id', POM_DEVELOPER_ID)
developer.appendNode('name', POM_DEVELOPER_NAME)
developer.appendNode('email', POM_DEVELOPER_EMAIL)
developer.appendNode('url', POM_DEVELOPER_URL)
developer.appendNode('timezone', '+8')
developer.appendNode('roles').appendNode('role', POM_DEVELOPER_ROLE)
}
}
}
}
// gradle bintrayUpload
bintray {
user = getBintrayUserProperty()
key = getBintrayApiKeyProperty()
publications = ['mavenJava']
// configurations = ['archives']
dryRun = false
publish = true
pkg {
//你在bintray建立的仓库类型
repo = 'maven'
//包名
name = ARTIFACT_ID
//描述
desc = POM_DESCRIPTION
//站点地址
websiteUrl = POM_URL
//缺陷提交地址
issueTrackerUrl = ISSUE_URL
//版本库地址
vcsUrl = GIT_URL
//许可证
licenses = ['Apache-2.0']
labels = ['java', 'network', 'HttpClient', 'okhttp3']
publicDownloadNumbers = true
version {
//版本号
name = VERSION_NAME
//版本描述
desc = POM_DESCRIPTION
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = BINTRAY_GPG_PWD//Optional. The passphrase for GPG signing'
}
// //添加部分
// mavenCentralSync {
// sync = true
// user = BINTRAY_OSS_USER
// password = BINTRAY_OSS_PASSWORD
// close = '1'
// }
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。