代码拉取完成,页面将自动刷新
def VERSION = '2.0.5'
def ARTIFACT_ID = 'unihttp-all'
def GROUP_ID = 'top.jfunc.network'
def TYPE = 'jar'
def DESCRIPTION = 'http客户端请求工具类,有多种实现:OkHttp3、ApacheHttpComponents、HttpURLConnection、Jodd-Http,可以随意切换http实现'
def gitUrl = 'https://gitee.com/xxssyyyyssxx/unihttp-all.git'
def siteUrl = 'https://gitee.com/xxssyyyyssxx/unihttp-all'
def REPO_NAME = 'network'
group GROUP_ID
version VERSION
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
ext{
CommonUtilVersion = 'v1.8.11'
OkHttp3Version = '3.14.9'
JoddVersion = '5.1.5'
ApacheHttpComponentsVersion = '4.5.12'
JUnitVersion = '4.12'
HamcrestVersion = '1.3'
MockServerVersion = '5.5.4'
}
dependencies {
//classpath "com.novoda:bintray-release:0.3.4"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
//用于上传到jcenter
apply plugin: 'com.jfrog.bintray'
//用于签名
//apply plugin: 'signing'
sourceCompatibility = 1.8
targetCompatibility = 1.8
jar {
manifest {
attributes('Version': "${version}")
attributes('Author': 'xiongshiyan')
attributes('Phone': '15208384257')
attributes('Build-By': 'Gradle-4.6')
attributes('Licences': 'Apache-2.0')
attributes('GitUrl-Gitee': 'https://gitee.com/xxssyyyyssxx/unihttp')
attributes('GitUrl-Github': 'https://github.com/xiongshiyan/unihttp')
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
compile ("com.gitee.xxssyyyyssxx:utils:${CommonUtilVersion}")
compile ("com.squareup.okhttp3:okhttp:${OkHttp3Version}")
compile ("org.apache.httpcomponents:httpclient:${ApacheHttpComponentsVersion}"){
exclude group:'commons-logging'
}
compile ("org.apache.httpcomponents:httpmime:${ApacheHttpComponentsVersion}"){
exclude group:'commons-logging'
}
// https://mvnrepository.com/artifact/org.jodd/jodd-http
compile ("org.jodd:jodd-http:${JoddVersion}")
// https://mvnrepository.com/artifact/com.netflix.ribbon/ribbon-core
compile 'com.netflix.ribbon:ribbon:2.7.18'
testCompile ("junit:junit:${JUnitVersion}")
testCompile ("org.hamcrest:hamcrest-core:${HamcrestVersion}")
testCompile ("org.hamcrest:hamcrest-library:${HamcrestVersion}")
// https://mvnrepository.com/artifact/org.mock-server/mockserver-netty
testCompile ("org.mock-server:mockserver-netty:${MockServerVersion}")
}
//Maven仓库的URL
//注意需要在防火墙的高级规则中添加允许入站规则http://bbs.csdn.net/topics/390728329
def MAVEN_REPO_RELEASE_URL= 'http://192.168.2.188:8081/nexus/content/repositories/releases/'
def MAVEN_REPO_SNAPSHOT_URL= 'http://192.168.2.188:8081/nexus/content/repositories/snapshots/'
//登录nexus ossde的用户名
def NEXUS_USERNAME='admin'
//登录nexus oss的密码
def NEXUS_PASSWORD='admin123'
/*uploadArchives {
configuration = configurations.archives
repositories {
mavenDeployer {
*//*snapshotRepository(url: MAVEN_REPO_SNAPSHOT_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
}
repository(url: MAVEN_REPO_RELEASE_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
}*//*
repository(url: uri('C:\\Users\\xiongshiyan\\.m2\\repository')) //定义本地maven仓库的地址
// repository(url: uri('C:\\Users\\xiongshiyan\\.gradle\\caches\\modules-2\\files-2.1')) //定义本地Gradle仓库的地址
pom.project {
version VERSION
artifactId ARTIFACT_ID
groupId GROUP_ID
packaging TYPE
description DESCRIPTION
}
}
}
}*/
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging TYPE
name ARTIFACT_ID
description DESCRIPTION
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'xxssyyyyssxx'
name 'xiongshiyan'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
/*signing {
sign configurations.archives
}*/
tasks.withType(Javadoc) {
/*options.encoding = 'UTF-8'*/
options{
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
options.addStringOption('Xdoclint:none', '-quiet')
}
bintray {
Properties properties = new Properties()
boolean isHasFile = false
if (project.rootProject.file('local.properties') != null){
isHasFile = true
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
user = isHasFile ? properties.getProperty("bintray.user") : System.getenv("bintray.user")
key = isHasFile ? properties.getProperty("bintray.apikey") : System.getenv("bintray.apikey")
configurations = ['archives']
pkg {
repo = REPO_NAME
name = ARTIFACT_ID //项目名称
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。