-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
151 lines (126 loc) · 4.77 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
group 'io.redskap'
version '2.5.0-SNAPSHOT'
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.2.5"
}
}
repositories {
mavenCentral()
}
def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}
subprojects {
group = rootProject.group
version = rootProject.version
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
sourceCompatibility = '17'
dependencies {
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
compileOnly "org.projectlombok:lombok:1.18.32"
annotationProcessor "org.projectlombok:lombok:1.18.32"
implementation 'com.google.guava:guava:33.2.0-jre'
implementation "org.apache.commons:commons-collections4:4.4"
implementation "org.apache.commons:commons-lang3:3.14.0"
implementation "org.apache.commons:commons-lang3:3.14.0"
implementation "org.springframework:spring-context:6.1.6"
implementation "org.springframework:spring-context:6.1.6"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.4"
testImplementation "org.assertj:assertj-core:3.25.3"
testImplementation "org.springframework:spring-test:6.1.6"
testImplementation "org.mockito:mockito-core:5.12.0"
testImplementation "org.mockito:mockito-junit-jupiter:5.12.0"
}
checkstyle {
toolVersion = '10.16.0'
}
tasks.withType(Checkstyle) {
reports {
xml.required = false
html.required = true
}
}
spotbugs {
reportLevel = 'high'
showProgress = false
}
//<editor-fold desc="Uploading to central">
apply plugin: 'signing'
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
artifact javadocJar
artifact sourcesJar
pom {
name = 'Swagger Brake'
packaging = 'jar'
description = 'Swagger contract checker for breaking API changes'
url = 'https://github.com/redskap/swagger-brake'
scm {
connection = 'scm:git:git://github.com/redskap/swagger-brake.git'
developerConnection = 'scm:git:ssh://github.com:redskap/swagger-brake.git'
url = 'https://github.com/redskap/swagger-brake'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'galovics'
name = 'Arnold Galovics'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/redskap/swagger-brake.git'
developerConnection = 'scm:git:ssh://github.com:redskap/swagger-brake.git'
url = 'https://github.com/redskap/swagger-brake'
}
}
}
}
repositories {
maven {
url = isReleaseBuild() ? 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' : 'https://oss.sonatype.org/content/repositories/snapshots/'
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
if (project.hasProperty('signing.keyId')) {
signing {
sign publishing.publications.mavenJava
}
}
//</editor-fold>
}