-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
97 lines (81 loc) · 3.19 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
plugins {
id 'net.researchgate.release' version '2.6.0'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'ivy-publish' // ivy publishing is for fallback if maven doesn't work.
apply plugin: 'maven'
apply plugin: 'signing'
dependencies {
compile 'javax.json:javax.json-api:1.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.1'
testCompile 'junit:junit:4.10'
}
group = "com.github.pgelinas"
version = "1.0.0"
release {
tagTemplate = 'v${version}'
}
repositories { mavenCentral() }
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier 'sources'
}
// Required for Maven central
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Maven central release use the "old" uploadArchives mechanism since maven-publish doesn't support signing yet.
artifacts {
archives javadocJar
archives sourcesJar
archives jar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") } // Only sign during release.
sign configurations.archives
}
// Maven central configuration.
uploadArchives {
repositories {
mavenDeployer(name: 'mavenCentral') {
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
// Add credentials only if they are present in the project.
// Avoid build failure if not trying to release and user doesn't have proper credentials.
if(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')){
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// All these are required for maven central release.
// See https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-6.CentralSyncRequirement
pom.project {
name 'jackson-javax-json'
packaging 'jar'
description 'An alternate implementation of JSR-353 based on Jackson, which aims to bring better performance and configurability.'
url 'https://github.com/pgelinas/jackson-javax-json'
scm {
url 'scm:git@github.com:pgelinas/jackson-javax-json.git'
connection 'scm:git@github.com:pgelinas/jackson-javax-json.git'
developerConnection 'scm:git@github.com:pgelinas/jackson-javax-json.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.html'
distribution 'repo'
}
}
developers {
developer {
id 'pgelinas'
name 'Pascal Gélinas'
email 'pascal.gelinas6@gmail.com'
}
}
}
}
}
}
task wrapper(type: Wrapper) { gradleVersion = '2.2.1' }