Skip to content

Add publish artifact support #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 82 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ plugins {
id "org.sonarqube" version "4.2.1.3168"
}

apply(plugin: "java");
apply(plugin: "java-library");
apply(plugin: "maven-publish");
apply(plugin: "signing");
apply(plugin: "biz.aQute.bnd.builder");
apply(plugin: "net.ltgt.errorprone");
apply(plugin: 'org.owasp.dependencycheck');
apply(plugin: 'maven-publish')
apply(plugin: 'java-library')
apply(from: "project.gradle");

Expand Down Expand Up @@ -99,15 +100,93 @@ artifacts {
archives javadocJar;
}


wrapper {
gradleVersion = "7.6.1";
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip";
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
maven(MavenPublication) {
mavenJava(MavenPublication) {
artifactId = 'json-patch-path'
from components.java
pom {
name = 'json-patch-path'
description = 'JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java, using extended TMF620 JsonPath syntax'
url = 'https://github.com/gravity9-tech/json-patch'

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'Piotr-Dytkowski'
name = 'Piotr Dytkowski'
email = 'piotr.dytkowski@gravity9.com'
organization = 'gravity9'
organizationUrl = 'https://www.gravity9.com/'
}
developer {
id = 'Bartlomiej-Styczynski'
name = 'Bartlomiej Styczynski'
email = 'bartlomiej.styczynski@gravity9.com'
organization = 'gravity9'
organizationUrl = 'https://www.gravity9.com/'
}
developer {
id = 'Piotr-Bugara'
name = 'Piotr Bugara'
email = 'piotr.bugara@gravity9.com'
organization = 'gravity9'
organizationUrl = 'https://www.gravity9.com/'
}
developer {
id = 'Garry-Newball'
name = 'Garry Newball'
email = 'garry.newball@gravity9.com'
organization = 'gravity9'
organizationUrl = 'https://www.gravity9.com/'
}
developer {
id = 'Mateusz-Zaremba'
name = 'Mateusz Zaremba'
email = 'mateusz.zaremba@gravity9.com'
organization = 'gravity9'
organizationUrl = 'https://www.gravity9.com/'
}
}
scm {
connection = 'scm:git:https://github.com/java-json-tools/json-patch.git'
developerConnection = 'scm:git:ssh://github.com:java-json-tools/json-patch.git'
url = 'https://github.com/gravity9-tech/json-patch'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}

signing {
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications.mavenJava
}
2 changes: 1 addition & 1 deletion dorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# This will build everything that is needed and push to Maven central.
#

./gradlew --refresh-dependencies clean test uploadArchives
./gradlew --refresh-dependencies clean test publish

8 changes: 7 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
version=2.0.0
version=2.0.0
signing.keyId=YourKeyId
signing.password=YourPublicKeyPassword
signing.secretKeyRingFile=PathToYourKeyRingFile

ossrhUsername=your-jira-id
ossrhPassword=your-jira-password
2 changes: 1 addition & 1 deletion project.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ javadoc.options {
links("https://www.javadoc.io/doc/com.google.guava/guava/32.0.1-android/");
links("https://java-json-tools.github.io/msg-simple/");
links("https://java-json-tools.github.io/jackson-coreutils/");
}
}