-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (105 loc) · 3.41 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
repositories {
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
//implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.apache.httpcomponents.client5:httpclient5:${httpClientVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
// Tests
//testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testImplementation("org.junit.jupiter:junit-jupiter:${junitVersion}")
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
test {
useJUnitPlatform()
systemProperties = System.properties
}
jar {
manifest {
attributes(
'Specification-Title': 'Java Client for the OpenCage REST API',
'Specification-Vendor': 'OpenCage GmbH',
'Specification-Version': archiveVersion,
'Implementation-Title': 'Java Client for the OpenCage REST API',
'Implementation-Vendor': 'OpenCage GmbH',
'Implementation-Version': archiveVersion,
)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'JOpenCage'
description = 'Java Client for the OpenCage REST API'
url = 'https://github.com/opencagedata/jopencage'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'OpenCageData'
name = 'OpenCage Data'
email = '[email protected]'
organizationUrl = 'https://opencagedata.com'
roles = [ 'maintainer' ]
}
}
contributors {
contributor {
id = 'moberwasserlechner'
name = 'Michael Oberwasserlechner'
email = '[email protected]'
roles = [ 'former maintainer']
}
}
scm {
connection = 'scm:git:git://github.com/opencagedata/jopencage.git'
developerConnection = 'scm:git:ssh://github.com/opencagedata/jopencage.git'
url = 'https://github.com/opencagedata/jopencage'
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.findProperty("MAVEN_USERNAME") ?: System.getenv("MAVEN_USERNAME")
password = project.findProperty("MAVEN_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
// def signingKeyId = (String) project.findProperty("OSSRH_GPG_SIGNING_KEY_ID") ?: System.getenv("OSSRH_GPG_SIGNING_KEY_ID")
// def signingKey = (String) project.findProperty("OSSRH_GPG_SECRET_KEY") ?: System.getenv("OSSRH_GPG_SECRET_KEY")
// def signingPassword = (String) project.findProperty("OSSRH_GPG_SECRET_KEY_PASSWORD") ?: System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD")
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}