diff --git a/build.gradle b/build.gradle index 18e613fb22..c1b3c0cd05 100644 --- a/build.gradle +++ b/build.gradle @@ -20,8 +20,8 @@ // 2. Change gradleVersion here // 3. Change the distributionUrl in gradle/wrapper/gradle-wrapper.properties // 4. Run ./gradlew wrapper -task wrapper(type: Wrapper) { - gradleVersion = '3.0' +wrapper() { + gradleVersion = '5.5.1' } // The project version is controlled externally by the "version.sh" script. @@ -51,7 +51,7 @@ buildscript { } dependencies { classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:1.7.0' - classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0" + classpath "com.diffplug.spotless:spotless-plugin-gradle:3.23.1" } } @@ -63,6 +63,7 @@ if (JavaVersion.current().isJava8Compatible()) { } } + subprojects { apply plugin: 'java' apply plugin: 'eclipse' @@ -70,6 +71,9 @@ subprojects { apply plugin: 'idea' apply plugin: 'com.diffplug.gradle.spotless' + sourceCompatibility = 11 + targetCompatibility = 11 + tasks.withType(Javadoc).all { enabled = false } // This is for disabling javadocs, related issue: https://github.com/gradle/gradle/issues/8267 repositories { mavenCentral() mavenLocal() @@ -100,18 +104,19 @@ subprojects { } dependencies { - compile 'com.google.guava:guava:25.1-jre' + compile 'javax.annotation:javax.annotation-api:1.3' //{ // https://github.com/grpc/grpc-java/issues/3633 + compile 'com.google.guava:guava:27.1-jre' compile 'org.mockito:mockito-all:1.9.5' - compile 'commons-codec:commons-codec:1.8' + compile 'commons-codec:commons-codec:1.12' compile 'com.google.code.findbugs:jsr305:2.0.1' - compile 'org.slf4j:slf4j-api:1.7.5' + compile 'org.slf4j:slf4j-api:1.7.26' compile 'ch.qos.logback:logback-classic:1.0.13' - compile 'joda-time:joda-time:2.2' + compile 'joda-time:joda-time:2.10.2' compile 'org.apache.thrift:libthrift:0.12.0' compile 'commons-configuration:commons-configuration:1.9' compile group: 'com.cinchapi', name: 'accent4j', version: '1.6.0', changing:true compile 'com.cinchapi:lib-config:1.5.1' - + testCompile 'junit:junit:4.11' } diff --git a/concourse-cli/build.gradle b/concourse-cli/build.gradle index f2eef067c4..0863992a04 100644 --- a/concourse-cli/build.gradle +++ b/concourse-cli/build.gradle @@ -23,7 +23,7 @@ signing { dependencies { compile project(':concourse-driver-java') - compile 'com.beust:jcommander:1.32' + compile 'com.beust:jcommander:1.72' compile 'jline:jline:2.11' } diff --git a/concourse-driver-java/build.gradle b/concourse-driver-java/build.gradle index 27d4b82dca..88ef75f1ca 100644 --- a/concourse-driver-java/build.gradle +++ b/concourse-driver-java/build.gradle @@ -22,13 +22,13 @@ signing { } dependencies { - compile 'org.slf4j:log4j-over-slf4j:1.7.5' - compile 'org.slf4j:jcl-over-slf4j:1.7.5' - compile 'com.google.code.gson:gson:2.5' + compile 'org.slf4j:log4j-over-slf4j:1.7.26' + compile 'org.slf4j:jcl-over-slf4j:1.7.26' + compile 'com.google.code.gson:gson:2.8.5' compile group: 'com.cinchapi', name: 'ccl', version:'2.6.1' testCompile project(':concourse-unit-test-core') - testCompile 'com.github.marschall:memoryfilesystem:0.9.0' + testCompile 'com.github.marschall:memoryfilesystem:2.1.0' } ext.uploadEnabled = true diff --git a/concourse-server/build.gradle b/concourse-server/build.gradle index 219b2d8d6b..ad1b211dbf 100644 --- a/concourse-server/build.gradle +++ b/concourse-server/build.gradle @@ -24,17 +24,17 @@ dependencies { compile project(':concourse-shell') compile project(':concourse-cli') compile project(':concourse-import') - compile 'com.beust:jcommander:1.32' + compile 'com.beust:jcommander:1.72' compile 'com.github.stephenc.high-scale-lib:high-scale-lib:1.1.4' - compile ('org.reflections:reflections:0.9.9-RC2'){ + compile ('org.reflections:reflections:0.9.11'){ exclude group: 'org.javassist', module:'javassist' } - compile 'org.javassist:javassist:3.18.2-GA' - compile 'org.eclipse.jetty:jetty-server:9.2.9.v20150224' - compile 'org.eclipse.jetty:jetty-webapp:9.2.9.v20150224' - compile 'com.github.spullara.mustache.java:compiler:0.8.15' + compile 'org.javassist:javassist:3.25.0-GA' + compile 'org.eclipse.jetty:jetty-server:9.4.13.v20181111' + compile 'org.eclipse.jetty:jetty-webapp:9.4.13.v20181111' + compile 'com.github.spullara.mustache.java:compiler:0.9.6' compile 'com.joestelmach:natty:0.12' - compile 'com.google.inject:guice:4.2.0' + compile 'com.google.inject:guice:4.2.2' compile 'io.atomix.catalyst:catalyst-buffer:1.1.1' compile 'com.cinchapi:process-watcher:1.0.0' compile (group:'com.cinchapi', name: 'bucket', version: bucketVersion, changing:true) { diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageDataCli.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageDataCli.java index 9eefd84e4f..b5312d90c8 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageDataCli.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageDataCli.java @@ -101,7 +101,7 @@ public String separators() { return null; } - @Override + // Used to Override public String optionPrefixes() { return null; } @@ -121,6 +121,10 @@ public String[] commandNames() { return null; } + @Override public boolean hidden() { + return false; + } + }; try { Object object = RuntimeDynamics.newAnonymousObject(); diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageEnvironmentsCli.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageEnvironmentsCli.java index 6b5c2f6fdb..5a109b7247 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageEnvironmentsCli.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageEnvironmentsCli.java @@ -102,7 +102,7 @@ public String separators() { return null; } - @Override + // Used to Override public String optionPrefixes() { return null; } @@ -122,6 +122,10 @@ public String[] commandNames() { return null; } + @Override public boolean hidden() { + return false; + } + }; try { Object object = RuntimeDynamics.newAnonymousObject(); diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManagePluginsCli.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManagePluginsCli.java index 5f69d5d4a1..bdb7d24056 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManagePluginsCli.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManagePluginsCli.java @@ -101,7 +101,7 @@ public String separators() { return null; } - @Override + // Used to Override public String optionPrefixes() { return null; } @@ -121,6 +121,10 @@ public String[] commandNames() { return null; } + @Override public boolean hidden() { + return false; + } + }; try { Object object = RuntimeDynamics.newAnonymousObject(); diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageUsersCli.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageUsersCli.java index 4f3ab7ad40..10911640f5 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageUsersCli.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/cli/ManageUsersCli.java @@ -101,7 +101,7 @@ public String separators() { return null; } - @Override + // Used to Override public String optionPrefixes() { return null; } @@ -121,6 +121,10 @@ public String[] commandNames() { return null; } + @Override public boolean hidden() { + return false; + } + }; try { Object object = RuntimeDynamics.newAnonymousObject(); diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/io/process/ServerProcesses.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/io/process/ServerProcesses.java index a138ea455c..78c6a59554 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/io/process/ServerProcesses.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/io/process/ServerProcesses.java @@ -57,7 +57,7 @@ public final class ServerProcesses { * @return the result of running the routine */ public static T fork(Forkable routine) { - Callback callback = new NoOpCallback(); + var callback = new NoOpCallback(); fork(routine, callback); return callback.getResult(); } @@ -76,41 +76,28 @@ public static T fork(Forkable routine) { * @param callback the {@link Callback} that handles the result * @return the result of running the routine */ - public static void fork(final Forkable routine, + public static void fork( + final Forkable routine, final Callback callback) { - String input = FileSystem.tempFile(); // use to serialize the #routine - // so it can be read by forked - // process - final String output = FileSystem.tempFile(); // used to serialize the - // return value for the - // #routine so it be read - // by this process - String source = FORK_TEMPLATE.replace("INSERT_INPUT_PATH", input) - .replace("INSERT_OUTPUT_PATH", output) + final var inputFilePath = FileSystem.tempFile(); + final var outputFilePath = FileSystem.tempFile(); + final var sourceCode = FORK_TEMPLATE + .replace("INSERT_INPUT_PATH", inputFilePath) + .replace("INSERT_OUTPUT_PATH", outputFilePath) .replace("INSERT_CLASS_NAME", routine.getClass().getName()); + final var inputChannel = FileSystem.getFileChannel(inputFilePath); - // Since the #routine is forked, we offer the external JVM process the - // local classpath - String classpath = StringUtils.join( - ((URLClassLoader) Thread.currentThread() - .getContextClassLoader()).getURLs(), - JavaApp.CLASSPATH_SEPARATOR); - FileChannel inputChannel = FileSystem.getFileChannel(input); try { Serializables.write(routine, inputChannel); - final JavaApp app = new JavaApp(classpath, source); + final var app = new JavaApp(sourceCode); app.run(); - new Thread(new Runnable() { // Wait for completion in separate - // thread so as to not block the caller - - @Override - public void run() { - Processes.waitForSuccessfulCompletion(app); - ByteBuffer result = FileSystem.readBytes(output); - T ret = Serializables.read(result, routine.getReturnType()); - callback.result(ret); - } + new Thread(() -> { + Processes.waitForSuccessfulCompletion(app); + final var resultBytes = FileSystem.readBytes(outputFilePath); + final var type = routine.getReturnType(); + final var result = Serializables.read(resultBytes, type); + callback.result(result); }).start(); } finally { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2b6b0bb944..1b864a58e0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip