forked from BetterCloud/vault-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
186 lines (159 loc) · 5.43 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
group 'se.tink'
archivesBaseName = 'vault-java-driver'
version '4.0.0-tink-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
repositories {
mavenCentral()
}
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
testCompile('junit:junit:4.12')
testCompile('org.mockito:mockito-core:2.23.4')
testCompile('org.testcontainers:testcontainers:1.16.2')
testCompile('commons-io:commons-io:2.6')
testCompile('org.eclipse.jetty:jetty-server:9.4.14.v20181114')
testCompile('org.slf4j:slf4j-api:1.7.25')
testCompile('org.bouncycastle:bcprov-jdk15on:1.60')
testCompile('org.bouncycastle:bcpkix-jdk15on:1.60')
testRuntime('org.slf4j:slf4j-simple:1.7.25')
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.2'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
//
// Separate unit tests from integration tests. See: `src/test-integration/README.md`
//
configurations {
unitTestsCompile.extendsFrom testCompile
unitTestsRuntime.extendsFrom testRuntime
integrationTestsCompile.extendsFrom testCompile
integrationTestsRuntime.extendsFrom testRuntime
}
sourceSets {
unitTests {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
java.srcDir file('src/test/java')
}
integrationTests {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
java.srcDir file('src/test-integration/java')
resources.srcDirs += file('src/test-integration/resources')
}
}
task unitTest(type: Test) {
testClassesDirs = sourceSets.unitTests.output.classesDirs
classpath = sourceSets.unitTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
}
task integrationTest(type: Test) {
testClassesDirs= sourceSets.integrationTests.output.classesDirs
classpath = sourceSets.integrationTests.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
}
//
// Deploying releases to Maven Central (or snapshots to a local Nexus repository).
//
// Snapshots are not signed... but signing the release artifact requires the following project properties:
//
// signing.keyId = <ID of the private key in your secure keyring used for signing JAR's>
// signing.password = <public key password>
// signing.secretKeyRingFile = <full path to your keyring file (i.e secring.gpg)>
//
if (!hasProperty('ossrhUsername')) {
ext.ossrhUsername = ''
}
if (!hasProperty('ossrhPassword')) {
ext.ossrhPassword = ''
}
if (!hasProperty('nexusUrl')) {
ext.nexusUrl = ''
}
if (!hasProperty('nexusUsername')) {
ext.nexusUsername = ''
}
if (!hasProperty('nexusPassword')) {
ext.nexusPassword = ''
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }
snapshotRepository(url: nexusUrl) {
authentication(userName: nexusUsername, password: nexusPassword)
}
pom.project {
name 'vault-java-driver'
packaging 'jar'
// optionally artifactId can be defined here
description 'Zero-dependency Java client for HashiCorp\'s Vault'
url 'https://github.com/BetterCloud/vault-java-driver'
scm {
connection 'https://github.com/BetterCloud/vault-java-driver.git'
developerConnection 'https://github.com/BetterCloud/vault-java-driver.git'
url 'https://github.com/BetterCloud/vault-java-driver'
}
licenses {
license {
name 'MIT'
url 'https://github.com/BetterCloud/vault-java-driver/blob/master/README.md'
}
}
developers {[
developer {
id 'steve-perkins'
name 'Steve Perkins'
email '[email protected]'
},
developer {
id 'steve-perkins-bc'
name 'Steve Perkins'
email '[email protected]'
},
developer {
id 'jarrodcodes'
name 'Jarrod Young'
email '[email protected]'
}
]}
}
}
}
}