@@ -3,64 +3,96 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
33
44plugins {
55 application
6- id(" io.freefair.lombok" ) version " 8.12.1"
7- id(" org.springframework.boot" ) version " 3.4.2"
8- id(" io.spring.dependency-management" ) version " 1.1.7"
9- id(" com.github.ben-manes.versions" ) version " 0.52.0"
10- id(" com.diffplug.spotless" ) version " 7.0.2"
6+ jacoco
7+ checkstyle
8+ alias(libs.plugins.lombok)
9+ alias(libs.plugins.versions)
10+ alias(libs.plugins.spotless)
11+ alias(libs.plugins.spring.boot)
12+ alias(libs.plugins.spring.dependency.management)
13+ alias(libs.plugins.shadow)
14+ alias(libs.plugins.sonarqube)
1115}
1216
1317group = " io.hexlet.blog"
14-
1518version = " 1.0-SNAPSHOT"
1619
17- application { mainClass.set(" io.hexlet.blog.Application" ) }
20+ application {
21+ mainClass.set(" io.hexlet.blog.Application" )
22+ }
1823
1924repositories {
2025 mavenCentral()
2126}
2227
2328dependencies {
24- implementation(" org.springframework.boot:spring-boot-starter-web" )
25- implementation(" org.springframework.boot:spring-boot-starter-data-jpa" )
26- implementation(" org.springframework.boot:spring-boot-starter-validation" )
27- implementation(" org.springframework.boot:spring-boot-devtools" )
28- implementation(" org.springframework.boot:spring-boot-starter-actuator" )
29- implementation(" org.springframework.boot:spring-boot-configuration-processor" )
30- implementation(" org.springframework.boot:spring-boot-starter-security" )
31- implementation(" org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.4" )
32- // implementation("io.sentry:sentry-spring-boot-starter-jakarta:6.28.0")
29+ // Spring Boot
30+ implementation(libs.springBootStarterWeb)
31+ implementation(libs.springBootStarterDataJpa)
32+ implementation(libs.springBootStarterValidation)
33+ implementation(libs.springBootStarterActuator)
34+ implementation(libs.springBootStarterSecurity)
35+ implementation(libs.springBootDevtools)
36+ implementation(libs.springBootConfigProcessor)
37+
38+ // OpenAPI
39+ implementation(libs.springdocOpenapiUi)
3340
34- implementation(" org.openapitools:jackson-databind-nullable:0.2.6" )
35- implementation(" org.mapstruct:mapstruct:1.6.3" )
36- annotationProcessor(" org.mapstruct:mapstruct-processor:1.6.3" )
41+ // Utilities
42+ implementation(libs.jacksonDatabindNullable)
43+ implementation(libs.commonsLang3)
44+ implementation(libs.datafaker)
45+ implementation(libs.instancioJunit)
46+ implementation(libs.jsonunitAssertj)
3747
38- runtimeOnly(" com.h2database:h2:2.2.224" )
39- implementation(" org.apache.commons:commons-lang3:3.17.0" )
40- implementation(" net.datafaker:datafaker:2.4.2" )
41- implementation(" org.instancio:instancio-junit:5.3.0" )
42- implementation(" net.javacrumbs.json-unit:json-unit-assertj:4.1.0" )
43- testImplementation(" org.springframework.boot:spring-boot-starter-test" )
44- testImplementation(platform(" org.junit:junit-bom:5.10.1" ))
45- testImplementation(" org.junit.jupiter:junit-jupiter:5.10.1" )
48+ // MapStruct
49+ implementation(libs.mapstruct)
50+ annotationProcessor(libs.mapstructProcessor)
51+
52+ // DB
53+ runtimeOnly(libs.h2)
54+
55+ // Tests
56+ testImplementation(libs.springBootStarterTest)
57+ testImplementation(platform(libs.junitBom))
58+ testImplementation(libs.junitJupiter)
59+ testRuntimeOnly(libs.junitPlatformLauncher)
60+ }
61+
62+ tasks.test {
63+ useJUnitPlatform()
64+ testLogging {
65+ exceptionFormat = TestExceptionFormat .FULL
66+ events =
67+ setOf (
68+ TestLogEvent .FAILED ,
69+ TestLogEvent .PASSED ,
70+ TestLogEvent .SKIPPED ,
71+ )
72+ showStandardStreams = true
73+ }
74+ }
75+
76+ tasks.jacocoTestReport {
77+ reports {
78+ xml.required.set(true )
79+ }
4680}
4781
4882spotless {
4983 java {
5084 importOrder()
5185 removeUnusedImports()
52- eclipse()
53- .sortMembersEnabled(true )
86+ eclipse().sortMembersEnabled(true )
5487 formatAnnotations()
5588 indentWithSpaces(4 )
5689 }
5790}
5891
59- tasks.test {
60- useJUnitPlatform()
61- testLogging {
62- exceptionFormat = TestExceptionFormat .FULL
63- events = mutableSetOf (TestLogEvent .FAILED , TestLogEvent .PASSED , TestLogEvent .SKIPPED )
64- showStandardStreams = true
92+ sonar {
93+ properties {
94+ property(" sonar.projectKey" , " hexlet-boilerplates_java-package" )
95+ property(" sonar.organization" , " hexlet-boilerplates" )
96+ property(" sonar.host.url" , " https://sonarcloud.io" )
6597 }
6698}
0 commit comments