plugins { id 'java-library' id 'maven-publish' id 'signing' id 'jacoco' id 'io.freefair.lombok' version '6.5.0.3' } repositories { mavenCentral() } dependencies { implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4' implementation 'org.slf4j:slf4j-api:1.7.36' testImplementation 'org.junit.platform:junit-platform-runner:1.9.0' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.0' testImplementation 'ch.qos.logback:logback-classic:1.2.11' testImplementation 'commons-io:commons-io:2.11.0' testImplementation 'org.mockito:mockito-core:4.8.0' } group = 'com.github.prominence' version = '3.0.0-SNAPSHOT' description = 'Java OpenWeatherMap API' configure([tasks.compileJava]) { sourceCompatibility = 8 } ext { isReleaseVersion = !version.endsWith("SNAPSHOT") } java { withSourcesJar() withJavadocJar() } test { useJUnitPlatform() } publishing { publications { mavenJava(MavenPublication) { from components.java pom { name = 'Java OpenWeatherMap API' description = 'Java API for OpenWeatherMap services.' url = 'https://github.com/Prominence/openweathermap-java-api' licenses { license { name = 'MIT License' url = 'https://www.opensource.org/licenses/mit-license.php' } } developers { developer { id = 'Prominence' name = 'Alexey Zinchenko' email = 'alexey.zinchenko@protonmail.com' url = 'https://github.com/prominence' } } scm { connection = 'scm:git:git://github.com/Prominence/openweathermap-java-api.git' developerConnection = 'scm:git:git@github.com:prominence/openweathermap-java-api.git' url = 'https://github.com/Prominence/openweathermap-java-api' } issueManagement { url = 'https://github.com/Prominence/openweathermap-java-api/issues' system = 'GitHub Issues' } } } } repositories { maven { credentials { username = project.findProperty('ossrhUsername') password = project.findProperty('ossrhPassword') } url = isReleaseVersion ? 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' : 'https://oss.sonatype.org/content/repositories/snapshots/' } } } signing { sign publishing.publications.mavenJava } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } tasks.withType(GenerateModuleMetadata) { enabled = false } jacocoTestReport { dependsOn test // tests are required to run before generating the report reports { csv.required = false xml.required = true xml.outputLocation = layout.buildDirectory.file('reports/jacoco/report.xml') html.outputLocation = layout.buildDirectory.dir('jacocoHtml') } }