From 1012edc290f512ee41cd41752420ca5b278b45ac Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Fri, 27 May 2022 01:20:23 +0000 Subject: [PATCH] feat: upgrade nashorn to 15.4 Signed-off-by: MiaoWoo --- pom.xml | 10 +++++----- .../java/pw/yumc/MiaoNashorn/MiaoNashorn.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index b885e48..3a785d8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 pw.yumc MiaoNashorn - 0.0.2 + 0.0.5 502647092 @@ -66,7 +66,7 @@ org.projectlombok lombok - 1.18.18 + 1.18.24 org.spigotmc @@ -77,18 +77,18 @@ org.spongepowered spongeapi - 7.2.0 + 7.3.0 compile net.md-5 bungeecord-api - 1.16-R0.4-SNAPSHOT + 1.16-R0.4 cn.nukkit nukkit - 2.0.0-SNAPSHOT + 1.0-SNAPSHOT compile diff --git a/src/main/java/pw/yumc/MiaoNashorn/MiaoNashorn.java b/src/main/java/pw/yumc/MiaoNashorn/MiaoNashorn.java index b9b29c4..4810b2f 100644 --- a/src/main/java/pw/yumc/MiaoNashorn/MiaoNashorn.java +++ b/src/main/java/pw/yumc/MiaoNashorn/MiaoNashorn.java @@ -18,7 +18,7 @@ import java.nio.file.StandardCopyOption; * @since 2016年8月29日 上午7:50:39 */ public class MiaoNashorn { - private static String MavenRepo = "https://maven.aliyun.com/repository/public"; + private static final String MavenRepo = "https://maven.aliyun.com/repository/public"; private static final Object ucp; private static final MethodHandle addURLMethodHandle; @@ -58,7 +58,7 @@ public class MiaoNashorn { File nashorn = new File(dir, "nashorn.jar"); if (nashorn.exists()) { loadJar(nashorn); - System.out.println("扩展目录发现 Nashorn 已加载完成!"); + log("扩展目录发现 Nashorn 已加载完成!"); } } } else { @@ -71,11 +71,11 @@ public class MiaoNashorn { libRootFile.mkdirs(); log("从云端加载 Nashorn 请稍候..."); String libRoot = libRootFile.getCanonicalPath(); - downloadJar(libRoot, "org.openjdk.nashorn", "nashorn-core", "15.3"); - downloadJar(libRoot, "org.ow2.asm", "asm", "9.2"); - downloadJar(libRoot, "org.ow2.asm", "asm-commons", "9.2"); - downloadJar(libRoot, "org.ow2.asm", "asm-tree", "9.2"); - downloadJar(libRoot, "org.ow2.asm", "asm-util", "9.2"); + downloadJar(libRoot, "org.openjdk.nashorn", "nashorn-core", "15.4"); + downloadJar(libRoot, "org.ow2.asm", "asm", "9.3"); + downloadJar(libRoot, "org.ow2.asm", "asm-commons", "9.3"); + downloadJar(libRoot, "org.ow2.asm", "asm-tree", "9.3"); + downloadJar(libRoot, "org.ow2.asm", "asm-util", "9.3"); log("云端 Nashorn 已加载完成!"); } @@ -84,7 +84,7 @@ public class MiaoNashorn { } private static void downloadJar(String engineRoot, String groupId, String artifactId, String version) throws Throwable { - File lib = new File(engineRoot, artifactId + ".jar"); + File lib = new File(engineRoot, String.format("%s-%s.jar", artifactId, version)); if (!lib.exists()) { log("正在下载类库 %s 版本 %s 请稍候...", artifactId, version); Files.copy(new URL(MavenRepo +