Index: build.gradle
===================================================================
--- build.gradle	(revision 35641)
+++ build.gradle	(working copy)
@@ -1,15 +1,18 @@
+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.28.0")
+  id("net.ltgt.errorprone").version("1.1.1")
+  id("org.kordamp.markdown.convert").version("1.2.0")
+  id("org.sonarqube").version("2.8")
+  id('com.github.spotbugs').version('4.0.3')
+  id('org.openstreetmap.josm').version("0.7.0")
+  id("com.diffplug.gradle.spotless").version("4.0.1")
 }
 
 apply from: 'gradle/tool-config.gradle'
@@ -34,15 +37,31 @@
   mavenCentral()
 }
 
+def versions = [
+  awaitility: "4.0.3",
+  jackson: "2.11.0",
+  jmockit: "1.46",
+  junit: "5.7.0",
+  wiremock: "2.27.1"
+]
+
 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")
+  }
+  compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
+  compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
+  compile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
+  compile "us.monoid.web:resty:0.3.2"
+  compile "log4j:log4j:1.2.17"
+  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
+  testCompile("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}") { because("versions >= 1.47 are incompatible with JOSM, see https://josm.openstreetmap.de/ticket/18200") }
+  testImplementation("org.awaitility:awaitility:${versions.awaitility}")
 }
 
 sourceSets {
@@ -68,14 +87,30 @@
   }
 }
 
+spotless {
+  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')
-  }
+  //i18n {
+   // pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
+  //}
 }
 
 eclipse {
@@ -99,7 +134,7 @@
 tasks.withType(Javadoc) {
   failOnError false
 }
-tasks.withType(com.github.spotbugs.SpotBugsTask) {
+tasks.withType(SpotBugsTask) {
   reports {
     xml.enabled = false
     html.enabled = true
@@ -109,6 +144,10 @@
 import org.gradle.api.tasks.testing.logging.TestLogEvent
 
 test {
+  project.afterEvaluate {
+    jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
+  }
+  useJUnitPlatform()
   testLogging {
     exceptionFormat "full"
     events TestLogEvent.FAILED, TestLogEvent.SKIPPED
Index: gradle/tool-config.gradle
===================================================================
--- gradle/tool-config.gradle	(revision 35641)
+++ gradle/tool-config.gradle	(working copy)
@@ -1,10 +1,11 @@
-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.21.0" // TODO: Update to PMD 6
+def spotbugsVersion = "4.0.3"
+def jacocoVersion = "0.8.5"
+def errorproneVersion = "2.3.4"
 
 // 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',
   '-Xep:ClassCanBeStatic:ERROR',
@@ -16,6 +17,7 @@
   '-Xep:LambdaFunctionalInterface:WARN',
   '-Xep:ConstantField:WARN']
 }
+*/
 
 // Spotbugs config
 spotbugs {
@@ -23,7 +25,7 @@
   ignoreFailures = true
   effort = "max"
   reportLevel = "low"
-  sourceSets = [sourceSets.main, sourceSets.test]
+  //sourceSets = [sourceSets.main, sourceSets.test]
 }
 
 // JaCoCo config
Index: gradle/wrapper/gradle-wrapper.properties
===================================================================
--- gradle/wrapper/gradle-wrapper.properties	(revision 35641)
+++ gradle/wrapper/gradle-wrapper.properties	(working copy)
@@ -1,5 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
+distributionSha256Sum=e58cdff0cee6d9b422dcd08ebeb3177bc44eaa09bd9a2e838ff74c408fe1cbcd
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
Index: ivy_settings.xml
===================================================================
--- ivy_settings.xml	(revision 35641)
+++ ivy_settings.xml	(working copy)
@@ -1,7 +1,7 @@
 <ivysettings>
-    <version-matchers usedefaults="true">
+    <!--<version-matchers usedefaults="true">
         <maven-tsnap-vm/>
-    </version-matchers>
+    </version-matchers>-->
     <settings defaultResolver="central"/>
     <resolvers>
         <ibiblio name="central" m2compatible="true"/>
