|
| 1 | +plugins { |
| 2 | + id 'java' |
| 3 | + id 'org.springframework.boot' version '3.4.6' |
| 4 | + id 'io.spring.dependency-management' version '1.1.5' |
| 5 | + id 'jacoco' |
| 6 | +} |
| 7 | + |
| 8 | +group = 'com.johnlpage' |
| 9 | +version = '1.0' |
| 10 | +description = 'MongoDB Enterprise Microservice Examples' |
| 11 | + |
| 12 | +java { |
| 13 | + toolchain { |
| 14 | + languageVersion = JavaLanguageVersion.of(17) |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +repositories { |
| 19 | + mavenCentral() |
| 20 | +} |
| 21 | + |
| 22 | +dependencyManagement { |
| 23 | + imports { |
| 24 | + mavenBom "io.cucumber:cucumber-bom:7.22.2" |
| 25 | + mavenBom "io.rest-assured:rest-assured-bom:5.5.5" |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +dependencies { |
| 30 | + // --- Main --- |
| 31 | + implementation 'org.springframework.boot:spring-boot-starter-actuator' |
| 32 | + implementation 'org.springframework.kafka:spring-kafka' |
| 33 | + implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' |
| 34 | + implementation 'org.springframework.boot:spring-boot-starter-web' |
| 35 | + implementation 'org.springframework.boot:spring-boot-starter-validation' |
| 36 | + |
| 37 | + // Lombok (compile only, annotation processor) |
| 38 | + compileOnly 'org.projectlombok:lombok' |
| 39 | + annotationProcessor 'org.projectlombok:lombok' |
| 40 | + |
| 41 | + // --- Test --- |
| 42 | + testImplementation 'org.springframework.boot:spring-boot-starter-test' |
| 43 | + testImplementation 'io.cucumber:cucumber-java' |
| 44 | + testImplementation 'io.cucumber:cucumber-spring' |
| 45 | + testImplementation 'io.cucumber:cucumber-junit-platform-engine' |
| 46 | + testImplementation 'org.junit.jupiter:junit-jupiter' |
| 47 | + testImplementation 'org.junit.platform:junit-platform-suite' |
| 48 | + testImplementation 'io.rest-assured:rest-assured' |
| 49 | + testImplementation 'io.rest-assured:json-path' |
| 50 | + testImplementation 'org.testcontainers:junit-jupiter' |
| 51 | + testImplementation 'org.springframework.kafka:spring-kafka-test' |
| 52 | + testImplementation 'org.testcontainers:mongodb' |
| 53 | + |
| 54 | + // Lombok annotation processor for tests |
| 55 | + testCompileOnly 'org.projectlombok:lombok' |
| 56 | + testAnnotationProcessor 'org.projectlombok:lombok' |
| 57 | +} |
| 58 | + |
| 59 | +// Make Spring Boot fat jar go to target/ |
| 60 | +bootJar { |
| 61 | + archiveBaseName.set('memex') |
| 62 | + archiveVersion.set(version) |
| 63 | + destinationDirectory = file("$projectDir/target") |
| 64 | +} |
| 65 | + |
| 66 | +// Jacoco coverage |
| 67 | +jacoco { |
| 68 | + toolVersion = "0.8.12" |
| 69 | +} |
| 70 | + |
| 71 | +tasks.test { |
| 72 | + useJUnitPlatform() |
| 73 | +} |
| 74 | + |
| 75 | +tasks.jacocoTestReport { |
| 76 | + dependsOn tasks.test |
| 77 | + reports { |
| 78 | + xml.required.set(true) |
| 79 | + html.required.set(true) |
| 80 | + } |
| 81 | +} |
0 commit comments