Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 3f0b0c3

Browse files
author
Explv
committed
Fix local script loading (by ignoring all exceptions thrown when attempting to load a class from the .jars)
1 parent e33236d commit 3f0b0c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.explv.explv_osbot_manager</groupId>
88
<artifactId>explv_osbot_manager</artifactId>
9-
<version>v2.0.7</version>
9+
<version>v2.0.8</version>
1010
<repositories>
1111
<repository>
1212
<id>local-repo</id>

src/main/java/file_manager/LocalScriptLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public final List<Script> getLocalScripts() {
4242
}
4343

4444
private void addScriptsFromJar(final JarFile jarFile, final ClassLoader classLoader, final List<Script> localScripts) {
45+
System.out.println(String.format("Loading jar: '%s'", jarFile.getName()));
4546
Enumeration entries = jarFile.entries();
4647
while (entries.hasMoreElements()) {
4748
JarEntry entry = (JarEntry) entries.nextElement();
@@ -59,7 +60,7 @@ private Optional<Script> getScriptFromClass(final ClassLoader classLoader, final
5960
if (scriptManifest != null) {
6061
return Optional.of(new Script(((ScriptManifest) scriptManifest).name(), "", true));
6162
}
62-
} catch (ClassNotFoundException ignored) {}
63+
} catch (Exception | NoClassDefFoundError ignored) {}
6364
return Optional.empty();
6465
}
6566
}

0 commit comments

Comments
 (0)