plugins { id "java" id "idea" id "ivy-publish" id "jacoco" id "java-library" id "signing" id "maven-publish" id "org.sonarqube" version "3.0" } version = "4.1.2-SNAPSHOT" group = "io.github.kobylynskyi" repositories { mavenCentral() jcenter() } dependencies { implementation "org.freemarker:freemarker:2.3.30" implementation "com.graphql-java:graphql-java:15.0" implementation "com.fasterxml.jackson.core:jackson-databind:2.12.1" testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.0" testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.0" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.0" testImplementation "org.hamcrest:java-hamcrest:2.0.0.0" } test.useJUnitPlatform() task codeCoverageReport(type: JacocoReport) { executionData fileTree(project.rootDir.absolutePath).include("build/jacoco/*.exec") sourceSets sourceSets.main reports { xml.enabled true xml.destination file("${buildDir}/reports/jacoco/report.xml") html.enabled false csv.enabled false } } test { testLogging { events "failed" showExceptions true exceptionFormat "full" showCauses true showStackTraces true showStandardStreams = false } } codeCoverageReport.dependsOn test compileJava.options.encoding = "UTF-8" compileTestJava.options.encoding = "UTF-8" java { withJavadocJar() withSourcesJar() } publishing { publications { mavenJava(MavenPublication) { artifactId "graphql-java-codegen" from components.java versionMapping { usage('java-api') { fromResolutionOf('runtimeClasspath') } usage('java-runtime') { fromResolutionResult() } } pom { name = "GraphQL Java CodeGen" description = "Java Code Generator based on GraphQL schema" url = "https://github.com/kobylynskyi/graphql-java-codegen" organization { name = "io.github.kobylynskyi" url = "https://github.com/kobylynskyi" } issueManagement { system = "GitHub" url = "https://github.com/kobylynskyi/graphql-java-codegen/issues" } licenses { license { name = "MIT License" url = "https://github.com/kobylynskyi/graphql-java-codegen/blob/master/LICENSE" distribution = "repo" } } scm { url = "https://github.com/kobylynskyi/graphql-java-codegen" connection = "scm:git:git://github.com/kobylynskyi/graphql-java-codegen.git" developerConnection = "scm:git:ssh://git@github.com:kobylynskyi/graphql-java-codegen.git" } developers { developer { id = "kobylynskyi" name = "Bogdan Kobylynskyi" email = "92bogdan@gmail.com" } } } } ivy(IvyPublication) { from components.java versionMapping { usage('java-api') { fromResolutionOf('runtimeClasspath') } usage('java-runtime') { fromResolutionResult() } } } } repositories { maven { url "https://oss.sonatype.org/service/local/staging/deploy/maven2" credentials { username sonatypeUsername password sonatypePassword } } ivy { url "${System.properties['user.home']}/.ivy2/local" patternLayout { artifact '[organisation]/[module]/[revision]/[ext]s/[artifact](-[classifier])(.[ext])' // for ci and local, must publish to ivy2 local, can be used for sbt plugin ivy '[organisation]/[module]/[revision]/[type]s/[artifact](.[ext])' } } } } if (project.hasProperty("signing.keyId")) { signing { sign publishing.publications.mavenJava } }