From 2769068068464b2888cb779f3f68e1e6a82ac49d Mon Sep 17 00:00:00 2001 From: "bartlomiej.styczynski" Date: Tue, 27 Jun 2023 12:05:00 +0200 Subject: [PATCH 1/3] Move to Java 11 and update Gradle version * Moved to Java 11 * Upgraded Gradle to 7.6.1 * Refactored gradle script to match new features * Upgraded errorprone gradle pluging to 3.0.1 * Changed version to 2.0.0 in preparation for release * Changed project and artifact name to java-json-tools --- build.gradle | 30 +++---------------- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- project.gradle | 38 ++++++++++-------------- settings.gradle | 2 +- 5 files changed, 23 insertions(+), 51 deletions(-) diff --git a/build.gradle b/build.gradle index 32e12990..3d201426 100644 --- a/build.gradle +++ b/build.gradle @@ -19,38 +19,20 @@ buildscript { repositories { - jcenter() mavenCentral() - maven { - url "https://repo.spring.io/plugins-snapshot"; - content { - includeGroupByRegex "io\\.spring\\.gradle\\.*" - } - } } dependencies { classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0' - classpath 'io.spring.gradle:propdeps-plugin:0.0.8-SNAPSHOT' classpath 'org.owasp:dependency-check-gradle:8.2.1' } }; 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("net.ltgt.errorprone") version "3.0.1" apply false } apply(plugin: "java"); -apply(plugin: "maven"); apply(plugin: "biz.aQute.bnd.builder"); -apply(plugin: "idea"); -apply(plugin: "eclipse"); apply(plugin: "net.ltgt.errorprone"); apply(plugin: 'org.owasp.dependencycheck'); apply(from: "project.gradle"); @@ -69,7 +51,6 @@ repositories { */ dependencies { errorprone('com.google.errorprone:error_prone_core:2.20.0') - errorproneJavac("com.google.errorprone:javac:9+181-r4173-1") } /* @@ -86,8 +67,8 @@ test { * Necessary to generate the source and javadoc jars */ task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources"; from sourceSets.main.allSource; + archiveClassifier.set("sources"); } /* @@ -105,8 +86,8 @@ allprojects { } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = "javadoc"; from javadoc.destinationDir; + archiveClassifier.set("javadoc"); } artifacts { @@ -115,10 +96,7 @@ artifacts { archives javadocJar; } - wrapper { - gradleVersion = "5.6.3"; + gradleVersion = "7.6.1"; distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"; } - - diff --git a/gradle.properties b/gradle.properties index 764e0e2c..e997a9af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=3.0.3-SNAPSHOT \ No newline at end of file +version=2.0.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3a54a333..31cca491 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/project.gradle b/project.gradle index 2776303a..386748b8 100644 --- a/project.gradle +++ b/project.gradle @@ -21,42 +21,36 @@ * Project-specific settings. Unfortunately we cannot put the name in there! */ group = "com.gravity9.java-json-tools"; -sourceCompatibility = JavaVersion.VERSION_1_7; -targetCompatibility = JavaVersion.VERSION_1_7; // defaults to sourceCompatibility +sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 project.ext.description = "JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java, using extended TMF620 JsonPath syntax"; /* * List of dependencies */ dependencies { - provided(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.2"); - compile(group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.15.2"); - compile(group: 'com.jayway.jsonpath', name: 'json-path', version: '2.8.0') - compile(group: "com.github.java-json-tools", name: "msg-simple", version: "1.2"); - compile(group: "com.github.java-json-tools", name: "jackson-coreutils", version: "2.0"); - testCompile(group: "org.testng", name: "testng", version: "7.1.0") { + compileOnly(group: "com.google.code.findbugs", name: "jsr305", version: "3.0.2"); + implementation(group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.15.2"); + implementation(group: 'com.jayway.jsonpath', name: 'json-path', version: '2.8.0') + implementation(group: "com.github.java-json-tools", name: "msg-simple", version: "1.2"); + implementation(group: "com.github.java-json-tools", name: "jackson-coreutils", version: "2.0"); + testImplementation(group: "org.testng", name: "testng", version: "7.1.0") { exclude(group: "junit", module: "junit"); exclude(group: "org.beanshell", module: "bsh"); exclude(group: "org.yaml", module: "snakeyaml"); }; - testCompile(group: "org.mockito", name: "mockito-core", version: "2.28.2"); - // FIXME: update to 3.x once we're off of Java 7 - testCompile(group: "org.assertj", name: "assertj-core", version: "2.9.1"); - testCompile(group: "com.google.guava", name: "guava", version: "28.2-android"); + testImplementation(group: "org.mockito", name: "mockito-core", version: "2.28.2"); + testImplementation(group: "org.assertj", name: "assertj-core", version: "3.24.2"); + testImplementation(group: "com.google.guava", name: "guava", version: "32.0.1-android"); } javadoc.options { - def currentJavaVersion = org.gradle.api.JavaVersion.current() - // FIXME: https://github.com/gradle/gradle/issues/11182 - if (currentJavaVersion.compareTo(org.gradle.api.JavaVersion.VERSION_1_9) >= 0) { - addStringOption("-release", "7"); - } - links("https://docs.oracle.com/javase/7/docs/api/"); + links("https://docs.oracle.com/javase/11/docs/api/"); links("https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/"); - links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.11.4/index.html"); - links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.11.4/index.html"); - links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/2.11.4/index.html"); - links("https://www.javadoc.io/doc/com.google.guava/guava/28.2-android/"); + links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.15.2/index.html"); + links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.15.2/index.html"); + links("https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/2.15.2/index.html"); + 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/"); } diff --git a/settings.gradle b/settings.gradle index a6a7a519..8a2a6e95 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,4 +17,4 @@ * - ASL 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt */ -rootProject.name = "json-patch-query"; +rootProject.name = "java-json-tools"; From 6ae9b975f767844ddaec57642804b85c789975a0 Mon Sep 17 00:00:00 2001 From: "bartlomiej.styczynski" Date: Tue, 27 Jun 2023 12:06:41 +0200 Subject: [PATCH 2/3] Move to Java 11 and update Gradle version * Removed unused azure pipeline --- azure-pipelines.yml | 51 --------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d81b3d12..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,51 +0,0 @@ -# Gradle -# Build your Java project and run tests with Gradle using a Gradle wrapper script. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/java - -trigger: -- master - -pool: - vmImage: ubuntu-latest - -steps: -- checkout: self - persistCredentials: true - displayName: "git credentials" -- script: | - git checkout $(Build.SourceBranchName) - git config --global user.name "Azure DevOps" - displayName: "git config" -- task: MavenAuthenticate@0 - displayName: 'authenticate maven' - inputs: - artifactsFeeds: bt -- task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.8' - jdkArchitectureOption: 'x64' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'clean test' - displayName: 'Gradle build and test' -- task: Gradle@2 - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.8' - jdkArchitectureOption: 'x64' - tasks: 'clean release -Prelease.useAutomaticVersion=true' - displayName: 'Gradle release and publish artifacts' -- task: PublishPipelineArtifact@1 - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - inputs: - targetPath: $(System.DefaultWorkingDirectory)/build/libs/ - displayName: "publish build artifact" From cf17a153d5b59044eea7cb18f31a092bdf2e1f10 Mon Sep 17 00:00:00 2001 From: "bartlomiej.styczynski" Date: Tue, 27 Jun 2023 12:39:02 +0200 Subject: [PATCH 3/3] Move to Java 11 and update Gradle version * Removed Travis badge from README (to be replaced with GH Actions badge) --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 580309ad..138b716b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![License LGPLv3][LGPLv3 badge]][LGPLv3] [![License ASL 2.0][ASL 2.0 badge]][ASL 2.0] -[![Build Status][Travis badge]][Travis] [![Maven Central][Maven Central badge]][Maven] ## Read me first @@ -39,17 +38,18 @@ With Gradle: ```groovy dependencies { - compile(group: "com.github.java-json-tools", name: "json-patch", version: "yourVersionHere"); + compile(group: "com.gravity9", name: "java-json-tools", version: "yourVersionHere"); } ``` With Maven: ```xml + - com.github.java-json-tools - json-patch - yourVersionHere + com.gravity9 + java-json-tools + yourVersionHere ``` @@ -436,7 +436,5 @@ Before: [LGPLv3]: http://www.gnu.org/licenses/lgpl-3.0.html [ASL 2.0 badge]: https://img.shields.io/:license-Apache%202.0-blue.svg [ASL 2.0]: http://www.apache.org/licenses/LICENSE-2.0.html -[Travis Badge]: https://travis-ci.com/java-json-tools/json-patch.svg?branch=master -[Travis]: https://travis-ci.com/java-json-tools/json-patch [Maven Central badge]: https://img.shields.io/maven-central/v/com.github.java-json-tools/json-patch.svg [Maven]: https://search.maven.org/artifact/com.github.java-json-tools/json-patch