-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
129 lines (117 loc) · 4.7 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
// SPDX-FileCopyrightText: the secureCodeBox authors
//
// SPDX-License-Identifier: Apache-2.0
plugins {
id 'java'
id "io.freefair.lombok" version "8.1.0"
id 'idea'
id 'maven-publish'
id 'jacoco'
id 'signing'
// https://github.com/ben-manes/gradle-versions-plugin
// Run: ./gradlew dependencyUpdates -Drevision=release
id "com.github.ben-manes.versions" version "0.47.0"
}
group 'io.securecodebox'
version (System.getenv("DD_CLIENT_VERSION") ? System.getenv("DD_CLIENT_VERSION") : '1.0.0-SNAPSHOT')
sourceCompatibility = '17'
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation group: 'org.springframework', name: 'spring-web', version: '5.3.28'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2'
testImplementation(platform('org.junit:junit-bom:5.9.3'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation 'org.springframework:spring-test:5.3.28'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testImplementation 'org.mockito:mockito-core:5.4.0'
testImplementation "org.mockito:mockito-junit-jupiter:5.4.0"
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.2'
}
publishing {
publications {
register("jar", MavenPublication) {
from(components["java"])
pom {
name = 'DefectDojo Client Java'
description = 'Java Client to interact with the DefectDojo API.'
url = 'https://github.com/secureCodeBox/defectdojo-client-java'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jannik.hollenbach'
name = 'Jannik Hollenbach'
email = 'jannik.hollenbach@iteratec.com'
}
developer {
id = 'robert.seedorff'
name = 'Robert Seedorff'
email = 'robert.seedorff@iteratec.com'
}
developer {
id = 'johannes.zahn'
name = 'Johannes Zahn'
email = 'johannes.zahn@iteratec.com'
}
}
scm {
connection = 'scm:git@github.com:secureCodeBox/defectdojo-client-java.git'
developerConnection = 'scm:git@github.com:secureCodeBox/defectdojo-client-java.git'
url = 'https://github.com/secureCodeBox/defectdojo-client-java'
}
}
}
}
repositories {
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 = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
// https://docs.gradle.org/current/userguide/signing_plugin.html
signing {
String signingKey = System.getenv("SIGNING_KEY")
String signingPassword = System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.jar
}
// https://github.com/johnrengelman/shadow/issues/718
tasks.withType(Zip).configureEach { task ->
task.doLast {
ant.checksum algorithm: 'md5', file: it.archivePath // required by sonatype
ant.checksum algorithm: 'sha1', file: it.archivePath // required by sonatype
ant.checksum algorithm: 'sha-256', file: it.archivePath, fileext: '.sha256'
ant.checksum algorithm: 'sha-512', file: it.archivePath, fileext: '.sha512'
}
}