-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (122 loc) · 4.94 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
plugins {
id "java-library"
id "idea"
id 'maven-publish'
alias(libs.plugins.lombok)
alias(libs.plugins.ebean)
alias(libs.plugins.sonarlint)
alias(libs.plugins.errorprone)
}
println "[INFO] ${project.group}:${project.name}:$version ⇒ ${tasks.jar.archiveFileName.get()} # JVM: ${System.getProperty("java.version")} Gradle: ${gradle.gradleVersion}"
repositories {
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all,-serial', '-parameters'])
options.release.set(17) // javac --release 7..22+
options.deprecation = true
options.errorprone {
enabled = true // <<<!!! You can disable Error-Prone here!
disableWarningsInGeneratedCode = true
excludedPaths = ".*/build/gen.*/.*"
disable("MissingSummary")
errorproneArgs = ["-XepExcludedPaths:.*/test/.*"]
}
}
dependencies {
errorprone("com.google.errorprone:error_prone_core:latest.release")
compileOnly(libs.bundles.coreAnnotation)
api("io.ebean:ebean:latest.release")
api(libs.hikariCP)
implementation(libs.bundles.jackson)
implementation(libs.jakarta.activationApi)
implementation(libs.jakarta.validationApi)
implementation(libs.slf4jApi, libs.slf4jJCL)
compileOnly("org.eclipse.microprofile.config:microprofile-config-api:latest.release")
compileOnly libs.micrometerCore
// compileOnly("io.ebean:ebean-agent:latest.release") // fix old ebean-agent bug → upgrade IDEA plugin,
//*** TEST TEST TEST ***
testAnnotationProcessor("io.ebean:querybean-generator:latest.release") // vs: annotationProcessor
testImplementation(libs.bundles.coreAnnotation)
testImplementation libs.bundles.junit
testImplementation(libs.testEasyRandom, libs.testEasyRandomValidation)
testImplementation("io.ebean:ebean-test:latest.release")
testImplementation("io.ebean:ebean-querybean:latest.release")
testCompileOnly('io.ebean:ebean-spring-txn:latest.release')// to show SpringJdbcTransactionManager
testImplementation("io.ebean:ebean-platform-h2:latest.release")
testImplementation("io.ebean:ebean-platform-mysql:latest.release")
testImplementation("io.ebean:ebean-platform-postgres:latest.release")
testImplementation("io.ebean:ebean-platform-sqlite:latest.release")
testImplementation("io.ebean:ebean-platform-sqlserver:latest.release")
testRuntimeOnly(libs.jdbc.h2, libs.jdbc.mssql)
testRuntimeOnly("org.eclipse.microprofile.config:microprofile-config-api:latest.release")
// testImplementation 'io.smallrye.config:smallrye-config:latest.release'
}
configurations.configureEach { // .implementation ? https://tomgregory.com/how-to-exclude-gradle-dependencies/
exclude group: 'io.ebean', module: 'ebean-datasource'
exclude group: 'io.ebean', module: 'ebean-joda-time'
exclude group: 'io.ebean', module: 'ebean-platform-all'
exclude group: 'io.ebean', module: 'ebean-platform-sqlanywhere'
exclude group: 'io.ebean', module: 'ebean-platform-oracle'
exclude group: 'io.ebean', module: 'ebean-platform-nuodb'
exclude group: 'io.ebean', module: 'ebean-platform-mariadb'
exclude group: 'io.ebean', module: 'ebean-platform-hsqldb'
exclude group: 'io.ebean', module: 'ebean-platform-hana'
exclude group: 'io.ebean', module: 'ebean-platform-db2'
exclude group: 'io.ebean', module: 'ebean-platform-clickhouse'
exclude group: "commons-logging", module: "commons-logging" // spring?
exclude group: 'org.springframework', module: 'spring-jcl'
exclude group: "org.apache.logging.log4j", module: "log4j-api"
exclude group: "org.apache.logging.log4j", module: "log4j-to-slf4j"
exclude group: "org.jboss.slf4j", module: "slf4j-jboss-logmanager"
exclude group: "com.mchange", module: "c3p0"
}
ebean {
debugLevel = 9 //0 - 9
// queryBeans = true
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true // show standard out & err of the test JVM on the console
showExceptions = true
exceptionFormat = 'full'
}
enableAssertions = true
maxHeapSize = "500m"
//systemProperty("slf4j.detectLoggerNameMismatch", "true")
systemProperty("file.encoding", "UTF-8")
systemProperty("user.language", "en")
Locale.setDefault(new Locale("en", "US"));
}
sonarLint {
isGeneratedCodeIgnored = true
ignoreFailures = true
}
lombok { version = "latest.release" }
publishing { // https://docs.gradle.org/current/userguide/publishing_maven.html
publications {
maven(MavenPublication) { // groupId in gradle.properties; artifactId == folder name
from components.java
suppressPomMetadataWarningsFor('runtimeElements')
}
}
}
java {
withSourcesJar()
// withJavadocJar()
}
idea { module { downloadJavadoc = true; downloadSources = true } }
jar {
from generatePomFileForMavenPublication {
rename('pom-default.xml', "META-INF/maven/${project.group}/${project.name}/pom.xml")
}
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}