From 5fc56de74a5b451aad9d72b26dd64c0dddd11b1f Mon Sep 17 00:00:00 2001 From: Osiris Team Date: Wed, 31 Jul 2024 19:09:23 +0200 Subject: [PATCH] 8.2.10 - fix self-updater losing terminal input when restarting by downgrading internal jansi library which was the cause --- pom.xml | 8 +++--- src/main/java/JPM.java | 11 ++++---- .../osiris/autoplug/client/SystemChecker.java | 26 ++++++++++++------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index d33fb96..1a50cd8 100644 --- a/pom.xml +++ b/pom.xml @@ -11,11 +11,11 @@ AUTO-GENERATED FILE, CHANGES SHOULD BE DONE IN ./JPM.java or ./src/main/java/JPM 4.0.0 com.osiris.autoplug.client AutoPlug-Client - 8.2.7 + 8.2.10 UTF-8 8 - 8.2.7 + 8.2.10 com.osiris.autoplug.client.Main 2.0.13 AutoPlug-Client @@ -63,7 +63,7 @@ AUTO-GENERATED FILE, CHANGES SHOULD BE DONE IN ./JPM.java or ./src/main/java/JPM com.github.Osiris-Team jansi - 2.4.6 + 2.4.2 compile @@ -126,7 +126,7 @@ AUTO-GENERATED FILE, CHANGES SHOULD BE DONE IN ./JPM.java or ./src/main/java/JPM com.github.Osiris-Team jansi - 2.4.6 + 2.4.2 compile diff --git a/src/main/java/JPM.java b/src/main/java/JPM.java index 0590d6c..b139fb9 100644 --- a/src/main/java/JPM.java +++ b/src/main/java/JPM.java @@ -21,7 +21,7 @@ public ThisProject(List args) { // Override default configurations this.groupId = "com.osiris.autoplug.client"; this.artifactId = "AutoPlug-Client"; - this.version = "8.2.7"; + this.version = "8.2.10"; this.mainClass = "com.osiris.autoplug.client.Main"; this.jarName = "AutoPlug-Client-original.jar"; this.fatJarName = "AutoPlug-Client.jar"; @@ -38,7 +38,7 @@ public ThisProject(List args) { forceImplementation("net.java.dev.jna:jna:5.14.0"); forceImplementation("net.java.dev.jna:jna-platform:5.14.0"); forceImplementation("commons-io:commons-io:2.16.1"); - forceImplementation("com.github.Osiris-Team:jansi:2.4.6"); + forceImplementation("com.github.Osiris-Team:jansi:2.4.2"); forceImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.23"); forceImplementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.9.23"); forceImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21"); @@ -51,7 +51,7 @@ public ThisProject(List args) { implementation("net.java.dev.jna:jna:5.14.0"); implementation("net.java.dev.jna:jna-platform:5.14.0"); implementation("commons-io:commons-io:2.16.1"); - implementation("com.github.Osiris-Team:jansi:2.4.6"); + implementation("com.github.Osiris-Team:jansi:2.4.2"); implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.23"); implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.9.23"); implementation("org.slf4j:slf4j-api:2.0.13"); @@ -88,8 +88,9 @@ public static void main(String[] _args) throws Exception { project.generatePom(); List mavenArgs = new ArrayList<>(); - mavenArgs.add("clean"); - mavenArgs.add("package"); + mavenArgs.add("clean");mavenArgs.add("package"); + //mavenArgs.addAll(Arrays.asList("dependency:purge-local-repository -Dinclude:jansi -DresolutionFuzziness=artifactId -Dverbose".split(" "))); + //mavenArgs.add("install"); if(!args.contains("test")) mavenArgs.add("-DskipTests"); JPM.executeMaven(mavenArgs.toArray(new String[0])); diff --git a/src/main/java/com/osiris/autoplug/client/SystemChecker.java b/src/main/java/com/osiris/autoplug/client/SystemChecker.java index f4086ce..5c4efd5 100644 --- a/src/main/java/com/osiris/autoplug/client/SystemChecker.java +++ b/src/main/java/com/osiris/autoplug/client/SystemChecker.java @@ -69,8 +69,21 @@ public void addShutDownHook() { try { if (Server.isRunning()) Server.stop(); } catch (Exception e) { - AL.warn("Error during shutdown, related to stopping the server!", e); + System.err.println("Error during shutdown, related to stopping the server!"); + e.printStackTrace(); + System.err.println("Error during shutdown, related to stopping the server!"); } + + try { + if (AL.isStarted) + SSHManager.stop(); + } catch (Exception e) { + System.out.println("Error during shutdown, related to stopping the SSH server!"); + e.printStackTrace(); + System.out.println("Error during shutdown, related to stopping the SSH server!"); + } + + // Stop Logger last try { if (AL.isStarted) { AL.info("See you soon!"); @@ -79,15 +92,10 @@ public void addShutDownHook() { System.out.println("See you soon!"); } } catch (Exception e) { - AL.warn("Error during shutdown, related to the AutoPlug-Logger!", e); + System.err.println("Error during shutdown, related to the AutoPlug-Logger!"); + e.printStackTrace(); + System.err.println("Error during shutdown, related to the AutoPlug-Logger!"); } - try { - SSHManager.stop(); - } catch (Exception e) { - AL.warn("Error during shutdown, related to stopping the server!", e); - } - - }, "Shutdown-Thread")); } }