Index: /applications/editors/josm/plugins/MicrosoftStreetside/build.gradle
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/build.gradle	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/build.gradle	(revision 35779)
@@ -1,14 +1,17 @@
+import com.github.spotbugs.snom.SpotBugsTask
+import net.ltgt.gradle.errorprone.CheckSeverity
+
 plugins {
-  id "org.sonarqube" version "2.6.2"
-  id "org.kordamp.markdown.convert" version "1.1.0"
-  id 'org.openstreetmap.josm' version "0.4.4"
-  id "com.github.ben-manes.versions" version "0.17.0"
-  id 'com.github.spotbugs' version '1.6.1'
-  id "net.ltgt.errorprone" version "0.0.14"
-
+  id 'java'
   id 'eclipse'
   id 'jacoco'
-  id 'java'
   id 'pmd'
+  id("com.github.ben-manes.versions").version("0.39.0")
+  id("net.ltgt.errorprone").version("2.0.2")
+  id("org.kordamp.markdown.convert").version("1.2.0")
+  id("org.sonarqube").version("3.3")
+  id('com.github.spotbugs').version('4.7.2')
+  id('org.openstreetmap.josm').version("0.7.1")
+  id("com.diffplug.spotless").version("5.14.1")
 }
 
@@ -33,15 +36,34 @@
   jcenter()
   mavenCentral()
+  maven {
+    url "https://josm.openstreetmap.de/nexus/content/repositories/releases/"
+  }
 }
 
+def versions = [
+  awaitility: "4.1.0",
+  jackson: "2.12.4",
+  jmockit: "1.49.a",
+  junit: "5.7.1",
+  wiremock: "2.27.2"
+]
+
 dependencies {
-  compile 'com.fasterxml.jackson.core:jackson-core:2.2.4'
-  compile 'com.fasterxml.jackson.core:jackson-databind:2.2.4'
-  compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.4'
-  compile 'us.monoid.web:resty:0.3.2'
-  compile 'log4j:log4j:1.2.17'
-  testImplementation ('org.openstreetmap.josm:josm-unittest'){changing=true}
-  testImplementation 'com.github.tomakehurst:wiremock:2.17.0'
-  testImplementation 'junit:junit:4.12'
+  if (!JavaVersion.current().isJava9Compatible()) {
+    errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
+  }
+  implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
+  implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
+  implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
+  implementation "us.monoid.web:resty:0.3.2"
+  implementation "log4j:log4j:1.2.17"
+  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
+  testImplementation("org.junit.jupiter:junit-jupiter-params:${versions.junit}")
+  testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
+  testImplementation("org.junit.vintage:junit-vintage-engine:${versions.junit}")
+  testImplementation ("org.openstreetmap.josm:josm-unittest"){changing=true}
+  testImplementation "com.github.tomakehurst:wiremock:${versions.wiremock}"
+  testImplementation("org.jmockit:jmockit:${versions.jmockit}")
+  testImplementation("org.awaitility:awaitility:${versions.awaitility}")
 }
 
@@ -69,12 +91,23 @@
 }
 
+spotless {
+  enforceCheck = false
+  format("misc") {
+    target("**/*.gradle", "**.*.md", "**/.gitignore")
+
+    trimTrailingWhitespace()
+    indentWithSpaces(2)
+    endWithNewline()
+  }
+  java {
+    trimTrailingWhitespace()
+    indentWithSpaces(2)
+    endWithNewline()
+    removeUnusedImports()
+  }
+}
+
 josm {
   debugPort = 7051
-  manifest {
-      //oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar')
-  }
-  i18n {
-    pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
-  }
 }
 
@@ -100,5 +133,5 @@
   failOnError false
 }
-tasks.withType(com.github.spotbugs.SpotBugsTask) {
+tasks.withType(SpotBugsTask) {
   reports {
     xml.enabled = false
@@ -110,4 +143,8 @@
 
 test {
+  project.afterEvaluate {
+    jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
+  }
+  useJUnitPlatform()
   testLogging {
     exceptionFormat "full"
Index: /applications/editors/josm/plugins/MicrosoftStreetside/config/pmd/ruleset.xml
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/config/pmd/ruleset.xml	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/config/pmd/ruleset.xml	(revision 35779)
@@ -7,44 +7,23 @@
     This ruleset checks some rules that you should normally follow for the ms-streetside-josm-plugin.
   </description>
-  <rule ref="rulesets/java/basic.xml"/>
-  <rule ref="rulesets/java/braces.xml">
-    <exclude name="IfStmtsMustUseBraces"/>
-  </rule>
-  <rule ref="rulesets/java/clone.xml"/>
 
-  <rule ref="rulesets/java/controversial.xml/UnnecessaryConstructor"/>
-  <rule ref="rulesets/java/controversial.xml/AssignmentInOperand"/>
-  <rule ref="rulesets/java/controversial.xml/DontImportSun"/>
-  <rule ref="rulesets/java/controversial.xml/SuspiciousOctalEscape"/>
-  <rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses"/>
-
-  <rule ref="rulesets/java/coupling.xml">
+  <rule ref="category/java/design.xml">
     <exclude name="LoosePackageCoupling" />
     <exclude name="LawOfDemeter" />
   </rule>
-  <rule ref="rulesets/java/design.xml">
-    <exclude name="AvoidSynchronizedAtMethodLevel" />
+  <rule ref="category/java/codestyle.xml">
     <exclude name="ConfusingTernary" />
-  </rule>
-  <rule ref="rulesets/java/empty.xml"/>
-  <rule ref="rulesets/java/finalizers.xml"/>
-  <rule ref="rulesets/java/imports.xml"/>
-  <rule ref="rulesets/java/naming.xml">
-    <exclude name="ShortVariable"/>
-    <exclude name="LongVariable"/>
-    <exclude name="AbstractNaming"/>
-  </rule>
-  <rule ref="rulesets/java/optimizations.xml">
     <exclude name="LocalVariableCouldBeFinal" />
     <exclude name="MethodArgumentCouldBeFinal" />
+    <exclude name="UselessParentheses" />
+    <exclude name="IfStmtsMustUseBraces"/>
+  </rule>
+  <rule ref="category/java/multithreading.xml">
+    <exclude name="AvoidSynchronizedAtMethodLevel" />
+  </rule>
+  <rule ref="category/java/bestpractices.xml"/>
+  <rule ref="category/java/errorprone.xml"/>
+  <rule ref="category/java/performance.xml">
     <exclude name="AvoidInstantiatingObjectsInLoops" />
   </rule>
-  <rule ref="rulesets/java/strictexception.xml"/>
-  <rule ref="rulesets/java/strings.xml"/>
-  <rule ref="rulesets/java/sunsecure.xml"/>
-  <rule ref="rulesets/java/typeresolution.xml"/>
-  <rule ref="rulesets/java/unnecessary.xml">
-    <exclude name="UselessParentheses" />
-  </rule>
-  <rule ref="rulesets/java/unusedcode.xml"/>
 </ruleset>
Index: /applications/editors/josm/plugins/MicrosoftStreetside/gradle.properties
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/gradle.properties	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/gradle.properties	(revision 35779)
@@ -7,11 +7,11 @@
 
 # Minimum required JOSM version to run this plugin, choose the lowest version possible that is compatible.
-# You can check if the plugin compiles against this version by executing `./gradlew minJosmVersionClasses`.
-plugin.main.version=16548
+# You can check if the plugin compiles against this version by executing `./gradlew compileJava_minJosm`.
+plugin.main.version=18004
 #plugin.version=
 # Version of JOSM against which the plugin is compiled
 # Please check, if the specified version is available for download from https://josm.openstreetmap.de/download/ .
 # If not, choose the next higher number that is available, or the gradle build will break.
-plugin.compile.version=17084
+plugin.compile.version=18004
 plugin.requires=apache-commons;apache-http;utilsplugin2;javafx
 
Index: /applications/editors/josm/plugins/MicrosoftStreetside/gradle/tool-config.gradle
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/gradle/tool-config.gradle	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/gradle/tool-config.gradle	(revision 35779)
@@ -1,9 +1,10 @@
-def pmdVersion = "5.8.0" // TODO: Update to PMD 6
-def spotbugsVersion = "3.1.3"
-def jacocoVersion = "0.8.1"
-def errorproneVersion = "2.3.1"
+def pmdVersion = "6.36.0"
+def spotbugsVersion = "4.3.0"
+def jacocoVersion = "0.8.7"
+def errorproneVersion = "2.7.1"
 
 // Set up ErrorProne (currently only for JDK8, until JDK9 is supported)
 dependencies.errorprone "com.google.errorprone:error_prone_core:$errorproneVersion"
+/*
 tasks.withType(JavaCompile) {
 options.compilerArgs += ['-Xep:DefaultCharset:ERROR',
@@ -17,4 +18,5 @@
   '-Xep:ConstantField:WARN']
 }
+*/
 
 // Spotbugs config
@@ -24,5 +26,5 @@
   effort = "max"
   reportLevel = "low"
-  sourceSets = [sourceSets.main, sourceSets.test]
+  //sourceSets = [sourceSets.main, sourceSets.test]
 }
 
Index: /applications/editors/josm/plugins/MicrosoftStreetside/gradle/wrapper/gradle-wrapper.properties
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/gradle/wrapper/gradle-wrapper.properties	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/gradle/wrapper/gradle-wrapper.properties	(revision 35779)
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
Index: /applications/editors/josm/plugins/MicrosoftStreetside/gradlew
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/gradlew	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/gradlew	(revision 35779)
@@ -1,3 +1,19 @@
 #!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# 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
+#
+#      https://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.
+#
 
 ##############################################################################
@@ -29,5 +45,5 @@
 
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
@@ -66,4 +82,5 @@
 
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
 
 # Determine the Java command to use to start the JVM.
@@ -110,8 +127,9 @@
 fi
 
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
     JAVACMD=`cygpath --unix "$JAVACMD"`
 
@@ -139,17 +157,17 @@
             eval `echo args$i`="\"$arg\""
         fi
-        i=$((i+1))
+        i=`expr $i + 1`
     done
     case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+        0) set -- ;;
+        1) set -- "$args0" ;;
+        2) set -- "$args0" "$args1" ;;
+        3) set -- "$args0" "$args1" "$args2" ;;
+        4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
     esac
 fi
@@ -160,13 +178,8 @@
     echo " "
 }
-APP_ARGS=$(save "$@")
+APP_ARGS=`save "$@"`
 
 # Collect all arguments for the java command, following the shell quoting and substitution rules
 eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
 
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
-  cd "$(dirname "$0")"
-fi
-
 exec "$JAVACMD" "$@"
Index: /applications/editors/josm/plugins/MicrosoftStreetside/gradlew.bat
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/gradlew.bat	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/gradlew.bat	(revision 35779)
@@ -1,2 +1,18 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
 @if "%DEBUG%" == "" @echo off
 @rem ##########################################################################
@@ -14,6 +30,9 @@
 set APP_HOME=%DIRNAME%
 
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
 
 @rem Find java.exe
@@ -22,5 +41,5 @@
 set JAVA_EXE=java.exe
 %JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if "%ERRORLEVEL%" == "0" goto execute
 
 echo.
@@ -36,5 +55,5 @@
 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
 
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
 
 echo.
@@ -46,19 +65,4 @@
 goto fail
 
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
 :execute
 @rem Setup the command line
@@ -66,6 +70,7 @@
 set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
 
+
 @rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
 
 :end
Index: /applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml	(revision 35779)
@@ -5,7 +5,7 @@
 	</configurations>
 	<dependencies>
-		<dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="2.2.4"/>
-        <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="2.2.4"/>
-        <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="2.2.4"/>
+		<dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="2.12.4"/>
+        <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="2.12.4"/>
+        <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="2.12.4"/>
         <dependency org="us.monoid.web" name="resty" rev="0.3.2"/>
         <dependency org="log4j" name="log4j" rev="1.2.17"/>
Index: /applications/editors/josm/plugins/MicrosoftStreetside/ivy_settings.xml
===================================================================
--- /applications/editors/josm/plugins/MicrosoftStreetside/ivy_settings.xml	(revision 35778)
+++ /applications/editors/josm/plugins/MicrosoftStreetside/ivy_settings.xml	(revision 35779)
@@ -1,6 +1,6 @@
 <ivysettings>
-    <version-matchers usedefaults="true">
+    <!--<version-matchers usedefaults="true">
         <maven-tsnap-vm/>
-    </version-matchers>
+    </version-matchers>-->
     <settings defaultResolver="central"/>
     <resolvers>
