-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
202 lines (178 loc) · 4.83 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
buildscript {
configurations.classpath {
resolutionStrategy.activateDependencyLocking()
}
}
plugins {
id('checkstyle')
id('java-library')
id('java-test-fixtures')
id('maven-publish')
id('signing')
alias(libs.plugins.prettyJupiter)
alias(libs.plugins.publishPlugin)
alias(libs.plugins.sonarlint)
alias(libs.plugins.spring.boot)
alias(libs.plugins.spring.management)
alias(libs.plugins.strictNullCheck)
}
group = 'io.github.joselion'
java {
sourceCompatibility = JavaLanguageVersion.of(17)
toolchain {
languageVersion = JavaLanguageVersion.of(22)
vendor = JvmVendorSpec.ORACLE
}
withJavadocJar()
withSourcesJar()
}
javadoc {
title('Spring R2DBC Relationships')
options {
encoding('UTF-8')
addBooleanOption('html5', true)
addStringOption('Xwerror', '-quiet')
tags('apiNote')
}
}
jar {
archiveClassifier = ''
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(sourceSets.main.allSource)
manifest {
attributes(
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-Jdk-Spec': java.sourceCompatibility,
'Created-By': "Gradle ${gradle.gradleVersion}",
'Implementation-Title': project.name,
'Implementation-Vendor': 'Jose Luis Leon',
'Implementation-Version': project.version,
'Package': "${project.group}.${project.name}",
)
}
}
bootJar {
enabled(false)
}
checkstyle {
setToolVersion(libs.versions.checkstyle.get())
setMaxWarnings(0)
}
sonarLint {
languages {
include('java')
}
rules {
enable(
'java:S4266', // "Stream.collect()" calls should not be redundant
)
disable(
'java:S107', // Allow constructors with more than 7 parameters
'java:S3776', // Allow methods with more than 15 lines
'java:S4032', // Allow packages only containing `package-info.java`
'java:S6203', // Allow textbloks in lambda expressions
)
}
}
strictNullCheck {
addEclipse(libs.versions.eclipse.get())
packageInfo {
useEclipse()
javadoc = '@author Jose Luis Leon'
}
}
dependencyLocking {
lockAllConfigurations()
}
repositories {
mavenCentral()
}
dependencies {
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
compileOnly(libs.spring.data.r2dbc)
compileOnly(libs.spring.webflux)
sonarlintCorePlugins(libs.sonarlint.java)
implementation(libs.maybe)
implementation(libs.reactor.extra)
testFixturesAnnotationProcessor(libs.lombok)
testFixturesCompileOnly(libs.lombok)
testFixturesImplementation(libs.spring.boot.r2dbc)
testFixturesImplementation(libs.spring.boot.webflux)
testFixturesRuntimeOnly(libs.h2)
testFixturesRuntimeOnly(libs.h2.r2dbc)
}
testing {
suites {
test {
useJUnitJupiter(libs.versions.junit.get())
dependencies {
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
runtimeOnly(libs.h2)
runtimeOnly(libs.h2.r2dbc)
implementation(libs.assertj.core)
implementation(libs.mockito.core)
implementation(libs.reactor.test)
implementation(libs.spring.boot.r2dbc)
implementation(libs.spring.boot.test)
implementation(libs.spring.boot.webflux)
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'spring-r2dbc-relationships'
packaging = 'jar'
description = 'Spring R2DBC annotations to handle entity relationships'
url = 'https://github.com/JoseLion/spring-r2dbc-relationships'
scm {
connection = 'scm:git:https://github.com/JoseLion/spring-r2dbc-relationships.git'
developerConnection = 'scm:git:ssh://github.com/JoseLion/spring-r2dbc-relationships.git'
url = 'https://github.com/JoseLion/spring-r2dbc-relationships'
}
licenses {
license {
name = 'MIT License'
url = 'https://github.com/JoseLion/spring-r2dbc-relationships/blob/main/LICENSE'
}
}
developers {
developer {
id = 'JoseLion'
name = "Jose Luis Leon"
email = '[email protected]'
}
}
}
}
}
}
components {
java {
withVariantsFromConfiguration(configurations.testFixturesApiElements) {
skip()
}
withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) {
skip()
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications.mavenJava)
}
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
}
}
}