代码拉取完成,页面将自动刷新
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'io.github.gradle-nexus.publish-plugin'
ext {
ossrhUsername = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
ossrhPassword = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
signingKey = findProperty("signingKey") ?: System.getenv("SIGNING_KEY")
signingPassword = findProperty("signingPassword") ?: System.getenv("SIGNING_PASSWORD")
}
task sourceJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
// ignore custom tags
tags = [
"title:a:title",
"package:a:package",
"description:a:description",
"date:a:date"
]
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
// GAV configuration
from components.java
artifact sourceJar
artifact javadocJar
afterEvaluate {
groupId = GROUP
artifactId = ARTIFACT_ID
version = project.version
}
// resolve the dynamic dependency version into the actual reference version, e.g., 1.2.+ -> 1.2.10
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
// pom relative information
pom {
name = ARTIFACT_ID
description = POM_DESCRIPTION
url = POM_URL
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
issueManagement {
system = 'Github'
url = ISSUE_URL
}
developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
email = POM_DEVELOPER_EMAIL
url = POM_DEVELOPER_URL
}
}
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
}
}
}
}
tasks.withType(GenerateMavenPom).all {
destination = "$buildDir/libs/${project.name}-${project.version}.pom"
}
build.dependsOn('sourceJar')
build.dependsOn('javadocJar')
build.dependsOn('generatePomFileForMavenJavaPublication')
signing {
useInMemoryPgpKeys(signingKey, signingPassword ?: "")
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype {
username = ossrhUsername
password = ossrhPassword
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。