1

Setup Sonatype publishing
All checks were successful
Build & Release / release-library (push) Successful in 2m8s

This commit is contained in:
2024-11-12 20:10:41 +01:00
parent 21c8543ea4
commit dff5a6d369
14 changed files with 421 additions and 126 deletions

View File

@@ -1,7 +1,25 @@
/**
Copyright (c) 2024 John Ahlroos
Creative Commons Attribution-NoDerivatives 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NoDerivatives 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Refer to LICENSE file or https://creativecommons.org/licenses/by-nd/4.0 for full license.
*/
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'maven-publish'
}
group = 'com.devsoap'
@@ -37,70 +55,8 @@ test {
}
}
publishing {
repositories {
maven {
name = "sonatype"
url = uri("https://central.sonatype.com/api/v1/publisher/upload")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "Bearer ${ findProperty('SONATYPE_TOKEN') as String }"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId = 'assertj-json'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'AssertJ JSON'
description = 'JSON assertions for AssertJ'
url = 'https://code.devsoap.com/john/assertj-json'
licenses {
license {
name = 'Creative Commons Attribution-NoDerivatives 4.0 International'
url = 'https://creativecommons.org/licenses/by-nd/4.0'
}
}
developers {
developer {
id = 'john'
name = 'John Ahlroos'
email = 'john@ahlroos.me'
organization = "Devsoap"
organizationUrl = "https://devsoap.com"
timezone = "Europe/Madrid"
}
}
scm {
connection = 'scm:git:ssh://git@code.devsoap.com:john/assertj-json.git'
developerConnection = 'scm:git:ssh://git@code.devsoap.com:john/assertj-json.git'
url = 'https://code.devsoap.com/john/assertj-json'
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask("publish") }
def signingKey = findProperty("DEVSOAP_GPG_KEY") as String
def signingPassword = findProperty("DEVSOAP_GPG_PASSWORD") as String
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
javadoc {
options.addBooleanOption('html5', true)
}
}
apply from: 'publish.gradle'