io.knotx.maven-publish.gradle.kts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of knotx-gradle-plugins Show documentation
Show all versions of knotx-gradle-plugins Show documentation
Knot.x Gradle Plugins minimize Knot.x modules Gradle configuration.
/*
* Copyright (C) 2019 Knot.x Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.knotx
plugins {
id("maven-publish")
id("signing")
}
publishing {
publications {
create("mavenJava") {
pom {
name.set("${project.findProperty("publication.name")}")
description.set("${project.findProperty("publication.description")}")
url.set("http://knotx.io")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("skejven")
name.set("Maciej Laskowski")
email.set("https://github.com/Skejven")
}
developer {
id.set("tomaszmichalak")
name.set("Tomasz Michalak")
email.set("https://github.com/tomaszmichalak")
}
}
scm {
connection.set("${project.findProperty("publication.scm")}")
developerConnection.set("${project.findProperty("publication.scm")}")
url.set("http://knotx.io")
}
}
}
repositories {
maven {
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = if (project.hasProperty("ossrhUsername")) project.property("ossrhUsername")?.toString() else "UNKNOWN"
password = if (project.hasProperty("ossrhPassword")) project.property("ossrhPassword")?.toString() else "UNKNOWN"
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT")
signing {
setRequired({
(project.extra["isReleaseVersion"] as Boolean)
})
}