Skip to content
Open
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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: java
jdk:
- openjdk8
- openjdk11
- openjdk17
install: {}
script:
- ./gradlew assemble check
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Kovács Zoltán (https://github.com/kz282)

* Upgrade to Jackson 3.0

## Ryan Lopopolo (https://github.com/lopopolo)

* Fix bug in JSON Patch add where target path is not a container node
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ only.
This is an implementation of [RFC 6902 (JSON Patch)](http://tools.ietf.org/html/rfc6902) and [RFC
7386 (JSON
Merge Patch)](http://tools.ietf.org/html/rfc7386) written in Java,
which uses [Jackson](https://github.com/FasterXML/jackson-databind) (2.2.x) at its core.
which uses [Jackson](https://github.com/FasterXML/jackson-databind) (3.0.x) at its core.

Its features are:

Expand All @@ -26,7 +26,7 @@ Its features are:

## Versions

The current version is **1.13**. See file `RELEASE-NOTES.md` for details of releases before 1.11.
The current version is **2.0**. See file `RELEASE-NOTES.md` for details of releases before 1.11.

## Using it in your project

Expand Down
282 changes: 87 additions & 195 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,233 +17,125 @@
* - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
*/

buildscript {
repositories {
mavenCentral()
maven {
url "http://repo.springsource.org/plugins-release";
}
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
classpath(group: "org.springframework.build.gradle", name: "propdeps-plugin", version: "0.0.7");
}
};

plugins {
id("net.ltgt.errorprone") version "0.8.1" apply false
}

configure(allprojects) {
apply(plugin: "propdeps");
apply(plugin: "propdeps-maven");
apply(plugin: "propdeps-idea");
apply(plugin: "propdeps-eclipse");
id "java-library"
id "maven-publish"
id "signing"
id "idea"
id "eclipse"
id "com.github.ben-manes.versions" version "0.51.0"
}

apply(plugin: "java");
apply(plugin: "maven");
apply(plugin: "signing");
apply(plugin: "biz.aQute.bnd.builder");
apply(plugin: "idea");
apply(plugin: "eclipse");
apply(plugin: "net.ltgt.errorprone");

apply(from: "project.gradle");
group = "com.github.java-json-tools"
version = "1.14-SNAPSHOT"
description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java"

group = "com.github.java-json-tools";

ext.forRelease = !version.endsWith("-SNAPSHOT");
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}

/*
* Repositories to use
*/
repositories {
mavenCentral();
if (!forRelease) {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
/* Allow staging references for last pre-release testing. */
if (project.properties.containsKey("sonatypeUsername")) {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.properties["sonatypeUsername"]
password = project.properties["sonatypePassword"]
}
}
}
mavenLocal()
mavenCentral()
}

/*
* Add errorprone checking.
*/
dependencies {
errorprone("com.google.errorprone:error_prone_core:2.3.3")
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
api "com.github.java-json-tools:jackson-coreutils:2.1-SNAPSHOT"
api "com.github.java-json-tools:msg-simple:1.2"
api "com.google.code.findbugs:jsr305:3.0.2"

testImplementation "org.testng:testng:7.9.0"
testImplementation "org.assertj:assertj-core:3.25.3"
testImplementation "org.mockito:mockito-core:5.11.0"
}

/*
* Necessary! Otherwise TestNG will not be used...
*
*/
test {
useTestNG() {
useDefaultListeners = true;
};
}

/*
* Necessary to generate the source and javadoc jars
*/
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources";
from sourceSets.main.allSource;
}

/*
* Lint all the things!
*/
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Xlint:-serial" << "-Werror"
}
tasks.withType(Javadoc) {
options.addStringOption('Xwerror', '-quiet')
}
useTestNG()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat = "full"
}
}

/*
* Javadoc: we need to tell where the overview.html is, it will not pick it up
* automatically...
*/

//javadoc {
// options.overview = "src/main/java/overview.html";
//}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc";
from javadoc.destinationDir;
javadoc {
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
}

artifacts {
archives jar;
archives sourcesJar;
archives javadocJar;
task testJar(type: Jar) {
archiveClassifier = "tests"
from sourceSets.test.output
}

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

task pom {
doLast {
pom {}.writeTo("${projectDir}/pom.xml");
}
artifacts {
tests testJar
}

/*
* SIGNING
*/

project.ext {
scmUrl = sprintf("[email protected]:java-json-tools/%s.git", name);
projectURL = sprintf("https://github.com/java-json-tools/%s", name);
sonatypeStaging = "https://oss.sonatype.org/service/local/staging/deploy/maven2/";
sonatypeSnapshots = "https://oss.sonatype.org/content/repositories/snapshots/";
};

task checkSigningRequirements {
doLast {
def requiredProperties = [ "sonatypeUsername", "sonatypePassword" ];
def noDice = false;
requiredProperties.each {
if (project.properties[it] == null) {
noDice = true;
System.err.printf("property \"%s\" is not defined!\n", it);
publishing {
publications {
mavenJava(MavenPublication) {
from components.java

artifact testJar

pom {
name = "JSON Patch"
description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java"
url = "https://github.com/java-json-tools/json-patch"

licenses {
license {
name = "Lesser General Public License, version 3 or greater"
url = "http://www.gnu.org/licenses/lgpl.html"
distribution = "repo"
}
license {
name = "Apache Software License, version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0"
distribution = "repo"
}
}

scm {
url = "https://github.com/java-json-tools/json-patch"
connection = "scm:git:git://github.com/java-json-tools/json-patch"
developerConnection = "scm:git:[email protected]:java-json-tools/json-patch"
}

developers {
developer {
id = "fge"
name = "Francis Galiegue"
email = "[email protected]"
}
}
}
}
if (noDice)
throw new IllegalStateException("missing required properties for " +
"upload");
}
}

uploadArchives {
dependsOn(checkSigningRequirements);

repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment);
}

repository(url: "${sonatypeStaging}") {
authentication(
userName: project.properties["sonatypeUsername"],
password: project.properties["sonatypePassword"]
);
}

snapshotRepository(url: "${sonatypeSnapshots}") {
authentication(
userName: project.properties["sonatypeUsername"],
password: project.properties["sonatypePassword"]
);
}
}
}
}

/*
* Configure pom.xml on install, uploadArchives
*/
[
install.repositories.mavenInstaller,
uploadArchives.repositories.mavenDeployer
]*.pom*.whenConfigured { pom ->
pom.project {
name "${project.name}";
packaging "jar";
description "${project.ext.description}";
url "${projectURL}";

scm {
url "${scmUrl}";
connection "${scmUrl}";
developerConnection "scm:git:${scmUrl}";
}

licenses {
license {
name "Lesser General Public License, version 3 or greater";
url "http://www.gnu.org/licenses/lgpl.html";
distribution "repo";
};
license {
name "Apache Software License, version 2.0";
url "http://www.apache.org/licenses/LICENSE-2.0";
distribution "repo";
}
}

developers {
developer {
id "huggsboson";
name "John Huffaker";
email "[email protected]";
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "N/A"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "N/A"
}
}
}
}

signing {
required { forRelease && gradle.taskGraph.hasTask("uploadArchives") };
sign configurations.archives;
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications.mavenJava
}


2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading