plugins { id 'java' id 'java-library' id 'maven-publish' id 'signing' } group 'org.bdware.bdcontract' version '0.1.0' sourceCompatibility = 1.8 repositories { mavenCentral() } task copyLibs(type: Copy) { from configurations.runtimeClasspath into "./build/output/libs/" } task copyJar(type: Copy, dependsOn: [":gmhelper:jar", ":gmhelper:copyLibs"]) { from "./build/libs/$project.name-${version}.jar" into "./build/output" rename { String fileName -> "gmhelper.jar" } doFirst { println "copyJar start" } } dependencies { api 'com.google.code.gson:gson:2.8.8' api 'org.bouncycastle:bcpkix-jdk15on:1.69' api 'org.bouncycastle:bcprov-jdk15on:1.69' testImplementation 'junit:junit:4.13.2' } task classJar(type: Jar, dependsOn: classes) { classifier = "jar" } task sourceJar(type: Jar, dependsOn: classes) { archiveClassifier = "sources" classifier = "sources" from sourceSets.main.allSource } tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } task javadocJar(type: Jar, dependsOn: javadoc) { archiveClassifier = 'javadoc' classifier = "javadoc" exclude { details -> details.file.getAbsolutePath().contains("/gm/") } from javadoc.destinationDir } publishing { publications { mavenJava(MavenPublication) { groupId project.group artifactId "gmhelper" version "${version}" from components.java artifact sourceJar artifact javadocJar artifact classJar pom { name = "bdware-gmhelper" description = "gmhelper" url = "https://gitee.com/BDWare/gmhelper" licenses { license { name = "Mulan PSL v2" url = "http://license.coscl.org.cn/MulanPSL2" } } developers { developer { id = "dataware" email = "caihq@pku.edu.cn" } } scm { connection = "scm:git:https://gitee.com/BDWare/gmhelper.git" developerConnection = "scm:git:https://gitee.com/BDWare/gmhelper.git" url = "https://gitee.com/BDWare/gmhelper" } } } } repositories { maven { name 'bdwareSnapshotRepository' url 'https://oss.sonatype.org/content/repositories/snapshots' credentials { username = "${NEXUS_USERNAME}" password = "${NEXUS_PASSWORD}" } } maven { name 'bdwareRepository' url 'https://oss.sonatype.org/service/local/staging/deploy/maven2' credentials { username = "${NEXUS_USERNAME}" password = "${NEXUS_PASSWORD}" } } } } signing { sign publishing.publications.mavenJava }