-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
175 lines (152 loc) · 5.08 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
plugins {
id "java"
id "com.github.spotbugs" version "6.0.26" apply false
id "org.owasp.dependencycheck" version "11.1.0" apply false
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
}
allprojects {
group = 'uk.co.autotrader'
version = "1.0.0"
}
project(':traverson4j-core').description("The kernel of traverson4j. This provides the main API for a client to traverse a Hypermedia REST service")
project(':traverson4j-hc5').description("An Apache HttpComponents 5 client to power traverson4j-core")
project(':traverson4j-jackson2').description("A ResourceConverter backed by Jackson 2 binding")
subprojects {
apply plugin: 'java-library'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.github.spotbugs'
apply plugin: 'org.owasp.dependencycheck'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
test {
useJUnitPlatform()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2',
'org.junit.jupiter:junit-jupiter-params:5.9.2',
'org.junit.jupiter:junit-jupiter-engine:5.9.2',
'com.google.guava:guava:31.1-jre',
'org.mockito:mockito-core:5.14.2',
'org.mockito:mockito-junit-jupiter:5.14.2',
'org.assertj:assertj-core:3.24.2',
'org.apache.commons:commons-lang3:3.12.0'
}
jacocoTestCoverageVerification {
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 1
}
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 1
}
}
}
}
spotbugs {
toolVersion = '4.8.6'
excludeFilter = file("${rootDir}/exclude.xml")
reportsDir = file("${rootDir}/spotbugs")
}
build {
dependsOn('jacocoTestCoverageVerification')
}
checkstyle {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
toolVersion = "10.20.2"
}
jar {
from('../LICENSE') {
into('META-INF/')
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}
publishing {
publications {
MavenPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "${project.name}"
description = project.description
url = 'https://github.com/autotraderuk/traverson4j'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'MikeRocke'
name = 'Michael Rocke'
email = '[email protected]'
organization = "Auto Trader"
organizationUrl = "https://www.autotrader.co.uk/"
}
developer {
id = 'shaunstorey'
name = 'Shaun Storey'
email = '[email protected]'
organization = "Auto Trader"
organizationUrl = "https://www.autotrader.co.uk/"
}
}
scm {
connection = 'scm:git:git://github.com/autotraderuk/traverson4j.git'
developerConnection = 'scm:git:ssh://github.com/autotraderuk/traverson4j.git'
url = 'https://github.com/autotraderuk/traverson4j'
}
}
}
}
}
}
nexusPublishing {
repositories {
sonatype()
}
}
project(':traverson4j-hc5') {
dependencies {
api project(':traverson4j-core')
}
}
project(':traverson4j-jackson2') {
dependencies {
api project(':traverson4j-core')
}
}