1+ plugins {
2+ id ' java'
3+ }
4+
5+ apply plugin : ' org.springframework.boot'
6+ apply plugin : ' io.spring.dependency-management'
7+
8+ java {
9+ toolchain {
10+ languageVersion = JavaLanguageVersion . of(21 )
11+ }
12+ }
13+
14+ // Don't publish this module
15+ bootJar { enabled = false }
16+ jar { enabled = false }
17+ tasks. matching { it. name. startsWith(' publish' ) }. configureEach {
18+ enabled = false
19+ }
20+
21+ repositories {
22+ mavenLocal()
23+ mavenCentral()
24+ maven {
25+ name = ' Spring Milestones'
26+ url = ' https://repo.spring.io/milestone'
27+ }
28+ maven {
29+ name = ' Spring Snapshots'
30+ url = ' https://repo.spring.io/snapshot'
31+ }
32+ }
33+
34+ // Tell gradle to add the generated sources directory
35+ sourceSets {
36+ main {
37+ java {
38+ srcDir file(" ${ buildDir} /generated/sources/annotationProcessor/java/main" )
39+ }
40+ }
41+ test {
42+ java {
43+ srcDir file(" ${ buildDir} /generated/sources/annotationProcessor/java/test" )
44+ }
45+ }
46+ }
47+
48+ dependencies {
49+ implementation project(' :redis-om-spring' )
50+
51+ // Important for RedisOM annotation processing!
52+ annotationProcessor project(' :redis-om-spring' )
53+ testAnnotationProcessor project(' :redis-om-spring' )
54+
55+ // Lombok
56+ compileOnly ' org.projectlombok:lombok'
57+ annotationProcessor ' org.projectlombok:lombok'
58+ testCompileOnly ' org.projectlombok:lombok'
59+ testAnnotationProcessor ' org.projectlombok:lombok'
60+
61+ // Spring Boot starters
62+ implementation ' org.springframework.boot:spring-boot-starter-web'
63+ implementation ' org.springframework.boot:spring-boot-starter-actuator'
64+ implementation ' org.springframework.boot:spring-boot-devtools'
65+
66+ // Test dependencies
67+ testImplementation ' org.springframework.boot:spring-boot-starter-test'
68+ testImplementation ' org.junit.jupiter:junit-jupiter'
69+ testImplementation ' org.assertj:assertj-core'
70+ testImplementation ' org.mockito:mockito-core'
71+ testImplementation " com.redis:testcontainers-redis:${ testcontainersRedisVersion} "
72+ testImplementation " org.testcontainers:junit-jupiter"
73+
74+ // Optional dependencies used by some demos
75+ implementation ' com.github.javafaker:javafaker:1.0.2'
76+ implementation ' org.springframework:spring-context-support'
77+ }
78+
79+ // Use -parameters flag for Spring
80+ tasks. withType(JavaCompile ). configureEach {
81+ options. compilerArgs << ' -parameters'
82+ options. fork = true
83+ options. forkOptions. jvmArgs << ' -Xshare:off'
84+ }
85+
86+ // Configure annotation processing
87+ compileJava {
88+ options. annotationProcessorPath = configurations. annotationProcessor
89+ options. generatedSourceOutputDirectory = file(" ${ buildDir} /generated/sources/annotationProcessor/java/main" )
90+ }
91+
92+ compileTestJava {
93+ options. annotationProcessorPath = configurations. testAnnotationProcessor
94+ options. generatedSourceOutputDirectory = file(" ${ buildDir} /generated/sources/annotationProcessor/java/test" )
95+ }
96+
97+ // Fix task dependencies for sourcesJar
98+ sourcesJar {
99+ dependsOn compileJava
100+ }
101+
102+ test {
103+ useJUnitPlatform()
104+ maxHeapSize = " 1g"
105+
106+ testLogging {
107+ events " passed" , " skipped" , " failed"
108+ exceptionFormat = ' full'
109+ }
110+ }
0 commit comments