plugins {
    id 'war'
    id 'jacoco-report-aggregation'
    alias(versions.plugins.asciidoctorConvention)
    alias(versions.plugins.javaConvention)
    alias(versions.plugins.sonarqube)
}

final BUILD_DATE = new Date().format('dd.MM.yyyy').toString()

dependencies {
    implementation versions.slf4j
    implementation versions.commonscli
    testImplementation versions.junit
    implementation versions.bundles.logback
    spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'

    implementation 'org.apache.wicket:wicket:9.9.1'
    implementation 'org.apache.wicket:wicket-extensions:9.9.1'
    testImplementation 'org.eclipse.jetty:jetty-webapp:9.4.44.v20210927'
    testImplementation 'org.eclipse.jetty:jetty-jmx:9.4.44.v20210927'
}

publishing {
    publications {
        application(MavenPublication) {
            groupId = group
            from components.java
        }
    }
}

jacocoTestReport {
    reports {
        xml.enabled true
    }
}

test.finalizedBy jacocoTestReport

spotbugs {
    ignoreFailures = true
}

sonarqube {
    properties {
        property "sonar.projectKey", "kontor_kontor-wicket_AYCAQ47WRCd9N673sSSD"
        property "sonar.host.url", "https://sonar.thpeetz.de"
        property "sonar.login", "7cf604ab1ebf48f7dc60d942c8196a132b228a6d"
        property "sonar.qualitygate.wait", true
        property "sonar.sourceEncoding", "UTF-8"
    }
}

tasks.named('sonarqube').configure {
    dependsOn test
}

wrapper {
    gradleVersion = "7.5"
}
