/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ plugins { id 'java' id "io.freefair.lombok" id 'jacoco' id 'com.github.johnrengelman.shadow' id 'maven-publish' id 'signing' } dependencies { implementation project(':opensearch-ml-common') compileOnly group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.3.1' } jacocoTestReport { reports { xml.getRequired().set(true) csv.getRequired().set(false) html.getRequired().set(true) } dependsOn test } jacocoTestCoverageVerification { violationRules { rule { limit { counter = 'LINE' minimum = 0.8 } limit { counter = 'BRANCH' minimum = 0.8 } } } dependsOn jacocoTestReport } check.dependsOn jacocoTestCoverageVerification shadowJar { archiveClassifier.set(null) } task sourcesJar(type: Jar) { archiveClassifier.set("sources") from sourceSets.main.allJava } task javadocJar(type: Jar) { archiveClassifier.set("javadoc") from javadoc.destinationDir dependsOn javadoc } publishing { repositories { maven { name = 'staging' url = "${rootProject.buildDir}/local-staging-repo" } maven { name = "Snapshots" url = "https://aws.oss.sonatype.org/content/repositories/snapshots" credentials { username "$System.env.SONATYPE_USERNAME" password "$System.env.SONATYPE_PASSWORD" } } } publications { shadow(MavenPublication) { publication -> project.shadow.component(publication) artifact sourcesJar artifact javadocJar pom { name = "OpenSearch Machine Learning Client" packaging = "jar" url = "https://github.com/opensearch-project/ml-commons" description = "OpenSearch Machine Learning Client" scm { connection = "scm:git@github.com:opensearch-project/ml-commons.git" developerConnection = "scm:git@github.com:opensearch-project/ml-commons.git" url = "git@github.com:opensearch-project/ml-commons.git" } licenses { license { name = "The Apache License, Version 2.0" url = "http://www.apache.org/licenses/LICENSE-2.0.txt" } } developers { developer { name = "OpenSearch" url = "https://github.com/opensearch-project/ml-commons" } } } } } }