-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (110 loc) · 4.15 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
plugins {
/**
* Provide Java project layout.
* https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_project_layout
* Can be removed because the "com.github.davidmc24.gradle.plugin.avro"
* already includes "groovy" plugin which extends "java" plugin.
* I keep it for clarification.
*/
id "java"
/**
* Generate avro files to classes.
* See https://github.com/davidmc24/gradle-avro-plugin#usage
*/
id "com.github.davidmc24.gradle.plugin.avro" version "1.3.0"
/**
* Compile Lombok annotations.
* See https://projectlombok.org/setup/gradle#the-lombok-gradle-plugin
*/
id "io.freefair.lombok" version "8.0.1"
/**
* Spring Boot repackaging.
* See https://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/html/build-tool-plugins-gradle-plugin.html
*/
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.1.0'
}
group 'com.emeraldhieu.springboottestcontainer'
version '1.0-SNAPSHOT'
/**
* Select specific JDK.
* See https://stackoverflow.com/questions/18487406/how-do-i-tell-gradle-to-use-specific-jdk-version#66443594
* See https://docs.gradle.org/current/userguide/toolchains.html
*/
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
repositories {
mavenCentral()
maven {
url "https://packages.confluent.io/maven/"
}
gradlePluginPortal()
}
ext.springBootVersion = "3.0.0"
ext.lombokVersion = "1.18.24"
ext.mapstructVersion = "1.5.2.Final"
ext.testContainersVersion = "1.18.3"
ext.postgresqlVersion = "42.6.0"
ext.avroVersion = "1.11.0"
ext.kafkaAvroSerializerVersion = "7.3.0"
ext.liquibaseSlf4jVersion = "4.1.0"
dependencies {
/**
* Import Maven BOM
* https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import
*/
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
implementation "org.springframework.boot:spring-boot-starter-web"
testImplementation "org.springframework.boot:spring-boot-starter-test"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.kafka:spring-kafka"
runtimeOnly "org.postgresql:postgresql"
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
compileOnly "org.projectlombok:lombok:${lombokVersion}"
/**
* Load Liquibase schema files for data migration.
*/
implementation "org.liquibase:liquibase-core"
/**
* Log Liquibase
See https://stackoverflow.com/questions/20880783/how-to-get-liquibase-to-log-using-slf4j#20880784
*/
implementation "com.mattbertolini:liquibase-slf4j:${liquibaseSlf4jVersion}"
/**
* Add mapstruct dependency and configure mapstruct annotation processor.
* See https://github.com/mapstruct/mapstruct#gradle
*/
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
/**
* Use common test-containers' annotations and postgres, kafka containers.
*/
testImplementation "org.testcontainers:postgresql:${testContainersVersion}"
testImplementation "org.testcontainers:kafka:${testContainersVersion}"
testImplementation "org.testcontainers:testcontainers:${testContainersVersion}"
testImplementation "org.testcontainers:junit-jupiter:${testContainersVersion}"
/**
* Use Avro annotations from the package "org.apache.avro".
*/
implementation "org.apache.avro:avro:${avroVersion}"
/**
* Use "org.apache.avro.specific" and "org.apache.avro.message".
*/
runtimeOnly "io.confluent:kafka-avro-serializer:${kafkaAvroSerializerVersion}"
}
generateAvroJava {
source("${projectDir}/src/main/resources/avro")
}
test {
useJUnitPlatform()
/**
* Stream Gradle's logs to console
* See https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle#9357286
*/
testLogging.showStandardStreams = true
}