plugins { id 'java' id 'application' id 'maven-publish' id 'jvm-test-suite' id 'jacoco' id 'test-report-aggregation' id 'jacoco-report-aggregation' alias(libs.plugins.spring.boot) alias(libs.plugins.spring.dependencies) alias(libs.plugins.vaadin) alias(libs.plugins.lombok) alias(libs.plugins.gradle.git.properties) } repositories { maven { setUrl("https://nexus.thpeetz.de/repository/maven-public") } mavenCentral() maven { setUrl("https://maven.vaadin.com/vaadin-prereleases") } maven { setUrl("https://repo.spring.io/milestone") } maven { setUrl("https://maven.vaadin.com/vaadin-addons") } } java { sourceCompatibility = JavaVersion.VERSION_21 } configurations { developmentOnly runtimeClasspath { extendsFrom developmentOnly } } dependencies { implementation 'com.vaadin:vaadin-core' implementation 'com.vaadin:vaadin-spring-boot-starter' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-artemis' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.security:spring-security-oauth2-jose' implementation 'org.springframework.security:spring-security-oauth2-resource-server' implementation 'org.apache.camel.springboot:camel-jms-starter' implementation 'org.apache.camel.springboot:camel-metrics-starter' implementation 'org.apache.camel.springboot:camel-micrometer-starter' implementation 'org.apache.camel.springboot:camel-spring-boot-starter' implementation 'org.apache.activemq:artemis-jakarta-client' //implementation libs.artemis developmentOnly 'org.springframework.boot:spring-boot-devtools' implementation 'io.micrometer:micrometer-registry-prometheus' implementation libs.jolokia.core implementation libs.prometheus.collector implementation 'com.h2database:h2' implementation libs.hsqldb implementation 'org.postgresql:postgresql' //runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' implementation libs.hypersistence implementation libs.mail implementation libs.jackson implementation libs.gson implementation libs.json implementation libs.jsoup implementation 'org.hibernate.orm:hibernate-community-dialects' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } testImplementation 'org.springframework.security:spring-security-test' testImplementation 'com.vaadin:vaadin-testbench-junit5' testImplementation 'io.projectreactor:reactor-test' testImplementation 'org.apache.camel:camel-test-spring-junit5' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' } dependencyManagement { imports { mavenBom libs.vaadin.bom.get().toString() mavenBom libs.camel.bom.get().toString() } } publishing { publications { bootJava(MavenPublication) { artifact tasks.named("bootJar") } } repositories { maven { url = version.endsWith('SNAPSHOT') ? 'https://nexus.thpeetz.de/repository/maven-snapshots' : 'https://nexus.thpeetz.de/repository/maven-releases' credentials { username = project.findProperty('nexusUser') password = project.findProperty('nexusPassword') } } } } application { mainClass = 'de.thpeetz.kontor.Application' } bootRun { args = ["--spring.profiles.active=${project.properties['profile'] ?: 'prod'}"] } springBoot { buildInfo() } task dockerImage(type: Exec) { dependsOn(bootJar) commandLine "docker", "build", ".", "-t", "kontor:${project.version}" } vaadin { productionMode = true } testing { suites { configureEach { useJUnitJupiter() dependencies { implementation project() implementation 'com.vaadin:vaadin-core' implementation 'com.vaadin:vaadin-spring-boot-starter' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'com.h2database:h2' implementation libs.hsqldb implementation libs.sqlite.jdbc //runtimeOnly 'com.mysql:mysql-connector-j' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' implementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } implementation 'org.springframework.security:spring-security-test' implementation 'com.vaadin:vaadin-testbench-junit5' implementation 'io.projectreactor:reactor-test' 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) { } } } wrapper { gradleVersion = libs.versions.gradle.get().toString() }