|
@@ -1,5 +1,4 @@
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'maven-publish'
|
|
-apply plugin: 'signing'
|
|
|
|
|
|
|
|
Properties rootLocalProperties = new Properties()
|
|
Properties rootLocalProperties = new Properties()
|
|
def rootLocalPropertiesFile = project.rootProject.file('local.properties')
|
|
def rootLocalPropertiesFile = project.rootProject.file('local.properties')
|
|
@@ -25,9 +24,6 @@ def getPropertyValue(key) {
|
|
return project.ext.has(key) ? project.ext.getProperty(key) : (project.rootProject.ext.has(key)?project.rootProject.ext.getProperty(key):null)
|
|
return project.ext.has(key) ? project.ext.getProperty(key) : (project.rootProject.ext.has(key)?project.rootProject.ext.getProperty(key):null)
|
|
}
|
|
}
|
|
|
|
|
|
-def mavenUsername = getPropertyValue("MAVEN_USER_NAME")
|
|
|
|
-def mavenPassword = getPropertyValue("MAVEN_PASSWORD")
|
|
|
|
-def mavenMail = getPropertyValue("MAVEN_LIB_USER_MAIL")
|
|
|
|
def projectGroupId = getPropertyValue('MAVEN_LIB_GROUP')
|
|
def projectGroupId = getPropertyValue('MAVEN_LIB_GROUP')
|
|
def projectArtifactId = getPropertyValue("MAVEN_LIB_ARTIFACTID")
|
|
def projectArtifactId = getPropertyValue("MAVEN_LIB_ARTIFACTID")
|
|
def projectVersionName = getPropertyValue("MAVEN_LIB_VERSION")
|
|
def projectVersionName = getPropertyValue("MAVEN_LIB_VERSION")
|
|
@@ -35,15 +31,6 @@ def projectDescription = getPropertyValue("MAVEN_LIB_DESCRIPTION")
|
|
def projectGitUrl = getPropertyValue("MAVEN_LIB_GIT_URL")
|
|
def projectGitUrl = getPropertyValue("MAVEN_LIB_GIT_URL")
|
|
def projectLicense = getPropertyValue("MAVEN_LIB_LICENSE")
|
|
def projectLicense = getPropertyValue("MAVEN_LIB_LICENSE")
|
|
def projectLicenseUrl = projectLicense ? "https://opensource.org/licenses/${projectLicense.toString().replace(" ", "-")} " : null
|
|
def projectLicenseUrl = projectLicense ? "https://opensource.org/licenses/${projectLicense.toString().replace(" ", "-")} " : null
|
|
-if (!mavenUsername) {
|
|
|
|
- println('missing parameter MAVEN_USER_NAME')
|
|
|
|
- return
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-if (!mavenPassword) {
|
|
|
|
- println('missing parameter MAVEN_PASSWORD')
|
|
|
|
- return
|
|
|
|
-}
|
|
|
|
|
|
|
|
if (!projectGroupId) {
|
|
if (!projectGroupId) {
|
|
println('missing parameter MAVEN_LIB_GROUP')
|
|
println('missing parameter MAVEN_LIB_GROUP')
|
|
@@ -125,8 +112,8 @@ afterEvaluate {
|
|
} else {
|
|
} else {
|
|
artifact("$buildDir/libs/${project.getName()}.jar")
|
|
artifact("$buildDir/libs/${project.getName()}.jar")
|
|
}
|
|
}
|
|
- artifact javadocsJar
|
|
|
|
- artifact sourcesJar
|
|
|
|
|
|
+// artifact javadocsJar
|
|
|
|
+// artifact sourcesJar
|
|
|
|
|
|
pom {
|
|
pom {
|
|
name = projectArtifactId
|
|
name = projectArtifactId
|
|
@@ -139,19 +126,6 @@ afterEvaluate {
|
|
url = projectLicenseUrl
|
|
url = projectLicenseUrl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- developers {
|
|
|
|
- developer {
|
|
|
|
- id = mavenUsername
|
|
|
|
- name = mavenUsername
|
|
|
|
- email = mavenMail
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // Version control info, if you're using GitHub, follow the format as seen here
|
|
|
|
- scm {
|
|
|
|
- connection = "scm:git:${projectGitUrl}"
|
|
|
|
- developerConnection = "scm:git:${projectGitUrl}"
|
|
|
|
- url = projectGitUrl
|
|
|
|
- }
|
|
|
|
withXml {
|
|
withXml {
|
|
def dependenciesNode = asNode().appendNode('dependencies')
|
|
def dependenciesNode = asNode().appendNode('dependencies')
|
|
def scopes = []
|
|
def scopes = []
|
|
@@ -200,34 +174,8 @@ afterEvaluate {
|
|
repositories {
|
|
repositories {
|
|
maven {
|
|
maven {
|
|
name = projectArtifactId
|
|
name = projectArtifactId
|
|
- def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
|
|
|
- def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
|
|
|
|
- url = projectVersionName.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
|
|
- credentials {
|
|
|
|
- username mavenUsername
|
|
|
|
- password mavenPassword
|
|
|
|
- }
|
|
|
|
|
|
+ url = uri("${rootProject.projectDir}/local-source")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
-
|
|
|
|
-signing {
|
|
|
|
- def signingKeyId = getPropertyValue("MAVEN_SIGNING_KEY_ID")
|
|
|
|
- def signingKey = getPropertyValue("MAVEN_SIGNING_KEY")
|
|
|
|
- def signingPassword = getPropertyValue("MAVEN_SIGNING_PASSWORD")
|
|
|
|
- if (!signingKeyId) {
|
|
|
|
- println('missing parameter MAVEN_SIGNING_KEY_ID')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!signingKey) {
|
|
|
|
- println('missing parameter MAVEN_SIGNING_KEY')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (!signingPassword) {
|
|
|
|
- println('missing parameter MAVEN_SIGNING_PASSWORD')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
|
|
|
|
- sign publishing.publications
|
|
|
|
}
|
|
}
|