plugins { id 'java' id 'jacoco' id 'org.springframework.boot' version '4.0.6' id 'io.spring.dependency-management' version '1.1.7' } group = 'se.bilhalsning' version = '0.0.1-SNAPSHOT' java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-flyway' implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-mail' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-webmvc' implementation 'org.flywaydb:flyway-database-postgresql' implementation 'org.jsoup:jsoup:1.18.1' implementation 'io.jsonwebtoken:jjwt-api:0.12.6' developmentOnly 'org.springframework.boot:spring-boot-devtools' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6' runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test' testImplementation 'org.springframework.boot:spring-boot-starter-flyway-test' testImplementation 'org.springframework.boot:spring-boot-starter-security-test' testImplementation 'org.springframework.boot:spring-boot-starter-validation-test' testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test' testCompileOnly 'org.projectlombok:lombok' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testAnnotationProcessor 'org.projectlombok:lombok' } tasks.named('test') { useJUnitPlatform() finalizedBy jacocoTestReport } jacoco { toolVersion = "0.8.12" } jacocoTestReport { dependsOn test reports { xml.required = true csv.required = false html.required = true } } jacocoTestCoverageVerification { dependsOn jacocoTestReport violationRules { rule { limit { minimum = 0.70 } } rule { limit { counter = 'BRANCH' minimum = 0.60 } } } } tasks.named('check').configure { dependsOn jacocoTestCoverageVerification } tasks.register('hashPassword', JavaExec) { group = 'utility' description = 'Print BCrypt hash for a password (strength 12). Usage: -Ppassword=secret' classpath = sourceSets.test.runtimeClasspath mainClass = 'se.bilhalsning.tools.BcryptHashCli' args = project.findProperty('password') ? [project.property('password')] : [] }