feat: upgrade nashorn to 15.4

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2022-05-27 01:20:23 +00:00
parent a5a265b44a
commit 1012edc290
2 changed files with 13 additions and 13 deletions

10
pom.xml
View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId> <groupId>pw.yumc</groupId>
<artifactId>MiaoNashorn</artifactId> <artifactId>MiaoNashorn</artifactId>
<version>0.0.2</version> <version>0.0.5</version>
<developers> <developers>
<developer> <developer>
<id>502647092</id> <id>502647092</id>
@ -66,7 +66,7 @@
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.18</version> <version>1.18.24</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
@ -77,18 +77,18 @@
<dependency> <dependency>
<groupId>org.spongepowered</groupId> <groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId> <artifactId>spongeapi</artifactId>
<version>7.2.0</version> <version>7.3.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.md-5</groupId> <groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId> <artifactId>bungeecord-api</artifactId>
<version>1.16-R0.4-SNAPSHOT</version> <version>1.16-R0.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.nukkit</groupId> <groupId>cn.nukkit</groupId>
<artifactId>nukkit</artifactId> <artifactId>nukkit</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -18,7 +18,7 @@ import java.nio.file.StandardCopyOption;
* @since 2016年8月29日 上午7:50:39 * @since 2016年8月29日 上午7:50:39
*/ */
public class MiaoNashorn { 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 Object ucp;
private static final MethodHandle addURLMethodHandle; private static final MethodHandle addURLMethodHandle;
@ -58,7 +58,7 @@ public class MiaoNashorn {
File nashorn = new File(dir, "nashorn.jar"); File nashorn = new File(dir, "nashorn.jar");
if (nashorn.exists()) { if (nashorn.exists()) {
loadJar(nashorn); loadJar(nashorn);
System.out.println("扩展目录发现 Nashorn 已加载完成!"); log("扩展目录发现 Nashorn 已加载完成!");
} }
} }
} else { } else {
@ -71,11 +71,11 @@ public class MiaoNashorn {
libRootFile.mkdirs(); libRootFile.mkdirs();
log("从云端加载 Nashorn 请稍候..."); log("从云端加载 Nashorn 请稍候...");
String libRoot = libRootFile.getCanonicalPath(); String libRoot = libRootFile.getCanonicalPath();
downloadJar(libRoot, "org.openjdk.nashorn", "nashorn-core", "15.3"); downloadJar(libRoot, "org.openjdk.nashorn", "nashorn-core", "15.4");
downloadJar(libRoot, "org.ow2.asm", "asm", "9.2"); downloadJar(libRoot, "org.ow2.asm", "asm", "9.3");
downloadJar(libRoot, "org.ow2.asm", "asm-commons", "9.2"); downloadJar(libRoot, "org.ow2.asm", "asm-commons", "9.3");
downloadJar(libRoot, "org.ow2.asm", "asm-tree", "9.2"); downloadJar(libRoot, "org.ow2.asm", "asm-tree", "9.3");
downloadJar(libRoot, "org.ow2.asm", "asm-util", "9.2"); downloadJar(libRoot, "org.ow2.asm", "asm-util", "9.3");
log("云端 Nashorn 已加载完成!"); log("云端 Nashorn 已加载完成!");
} }
@ -84,7 +84,7 @@ public class MiaoNashorn {
} }
private static void downloadJar(String engineRoot, String groupId, String artifactId, String version) throws Throwable { 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()) { if (!lib.exists()) {
log("正在下载类库 %s 版本 %s 请稍候...", artifactId, version); log("正在下载类库 %s 版本 %s 请稍候...", artifactId, version);
Files.copy(new URL(MavenRepo + Files.copy(new URL(MavenRepo +