5 Star 8 Fork 2

xxssyyyyssxx / json-common

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 4.70 KB
一键复制 编辑 原始数据 按行查看 历史
def VERSION = '1.8.2'
def ARTIFACT_ID = 'json-common'
def GROUP_ID = 'top.jfunc.json'
def TYPE = 'jar'
def DESCRIPTION = 'common json interface define and base impl with map and list'
def gitUrl = 'https://gitee.com/xxssyyyyssxx/json-common.git'
def siteUrl = 'https://gitee.com/xxssyyyyssxx/json-common'
def REPO_NAME = 'json'
group GROUP_ID
version VERSION
buildscript {
repositories {
jcenter()
}
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: 'maven-publish'
//用于上传到jcenter
apply plugin: 'com.jfrog.bintray'
//用于签名
//apply plugin: 'signing'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
//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
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
version VERSION
artifactId ARTIFACT_ID
groupId GROUP_ID
from components.java
// more goes in here
}
}
repositories {
mavenLocal()
}
}
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 'xxssyyyyssxx@126.com'
}
}
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
}
}
Java
1
https://gitee.com/xxssyyyyssxx/json-common.git
git@gitee.com:xxssyyyyssxx/json-common.git
xxssyyyyssxx
json-common
json-common
master

搜索帮助