plugins { id 'java' //id 'application' id 'jacoco' id 'test-report-aggregation' id 'jacoco-report-aggregation' alias(libs.plugins.lombok) } repositories { mavenCentral() } dependencies { implementation libs.javalin.bundle compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' implementation libs.postgresql implementation libs.hibernate annotationProcessor libs.hibernate.modelgen testImplementation( platform( libs.junit.bom.get().toString() )) testImplementation "org.junit.jupiter:junit-jupiter" testRuntimeOnly 'org.junit.platform:junit-platform-launcher' implementation libs.jackson // For JSON serialization of persons implementation libs.slf4j // To see some Javalin logging } testing { suites { configureEach { useJUnitJupiter() dependencies { implementation project() implementation libs.hsqldb implementation libs.sqlite.jdbc runtimeOnly 'org.junit.platform:junit-platform-launcher' } } test(JvmTestSuite) { targets { all { testTask.configure { reports { junitXml { outputPerTestCase = true // defaults to false mergeReruns = true // defaults to false } } finalizedBy(jacocoTestReport) } } } } integrationTest(JvmTestSuite) { targets { all { testTask.configure { shouldRunAfter(test) finalizedBy(jacocoTestReport) } } } } } } tasks.named('check') { dependsOn(testing.suites.integrationTest) dependsOn(testing.suites.test) dependsOn tasks.named('testAggregateTestReport', TestReport) dependsOn tasks.named('integrationTestAggregateTestReport', TestReport) } jacocoTestReport { dependsOn test, integrationTest reports { xml.required = true csv.required = false } } reporting { reports { testAggregateTestReport(AggregateTestReport) { } integrationTestAggregateTestReport(AggregateTestReport) { } integrationTestCodeCoverageReport(JacocoCoverageReport) { } } } // application { // mainClass = 'de.thpeetz.kontor.api.Main' // } task fatJar(type: Jar) { manifest { attributes 'Main-Class': 'de.thpeetz.kontor.Main' } duplicatesStrategy = DuplicatesStrategy.EXCLUDE from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } with jar } build.dependsOn fatJar // distZip.dependsOn fatJar // distTar.dependsOn fatJar // startScripts.dependsOn fatJar wrapper { gradleVersion = "9.2.1" }