Skip to content

Instantly share code, notes, and snippets.

@keehyun2
Last active October 17, 2017 08:37
Show Gist options
  • Save keehyun2/cb53c672e7a2148e5d391cc9f5fc651a to your computer and use it in GitHub Desktop.
Save keehyun2/cb53c672e7a2148e5d391cc9f5fc651a to your computer and use it in GitHub Desktop.
buildscript {
repositories {
jcenter()
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
group = 'com.github.keehyun2'
description = 'bowl'
version = '0.1.3'
allprojects {
repositories {
jcenter()
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "keehyun2"
name "keehyun Park"
email "keehyun2@gmail.com"
}
}
scm {
url "https://github.com/keehyun2/bowl"
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'com.github.keehyun2'
artifactId 'bowl'
version '0.1.3'
pom.withXml {
def root = asNode()
root.appendNode('description', 'Useful functions')
root.appendNode('name', 'bowl')
root.appendNode('url', 'https://github.com/keehyun2/bowl')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['MyPublication']
dryRun = false //[Default: false] Whether to run this as dry-run, without deploying
publish = true //[Default: false] Whether version should be auto published after an upload
override = true //[Default: false] Whether to override version artifacts already published
pkg {
repo = 'maven'
name = 'bowl'
userOrg = 'keehyun20'
desc = 'what a fantastic package indeed!'
websiteUrl = 'https://github.com/keehyun2/bowl'
issueTrackerUrl = 'https://github.com/keehyun2/bowl/issues'
vcsUrl = 'https://github.com/keehyun2/bowl.git'
licenses = ['Apache-2.0']
labels = ['keehyun2', 'keehyun Park', 'bowl']
publicDownloadNumbers = true
githubRepo = 'keehyun2/bowl' //Optional Github repository
githubReleaseNotesFile = 'README.md' //Optional Github readme file
version {
name = '0.1.3'
desc = 'bowl util 0.1.3'
released = new Date()
vcsTag = '0.1.3'
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = project.property('gpg.passphrase') //Optional. The passphrase for GPG signing'
}
//Optional configuration for Maven Central sync of the version
mavenCentralSync {
sync = true //[Default: true] Determines whether to sync the version to Maven Central.
user = project.property('mavenCentral.user') //OSS user token: mandatory
password = project.property('mavenCentral.password') //OSS user password: mandatory
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
// nexus 업로드 관련코드
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://nexus.khphub.com/repository/maven-releases/") {
authentication(userName: project.property('nexus.user'), password: project.property('nexus.pw'))
}
pom.version = "0.1.3"
pom.groupId = "com.github.keehyun2"
pom.artifactId = "bowl"
}
}
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.4'
compile group: 'commons-io', name: 'commons-io', version:'2.5'
compile group: 'commons-collections', name: 'commons-collections', version:'3.2.2'
compile group: 'com.google.guava', name: 'guava', version:'23.0'
compile group: 'com.google.code.gson', name: 'gson', version:'2.8.2'
compile group: 'com.h2database', name: 'h2', version:'1.4.196'
compile group: 'joda-time', name: 'joda-time', version:'2.9.9'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment