File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
src/main/java/com/scalar/kelpie/modules Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ repositories {
1010}
1111
1212dependencies {
13- implementation group : ' com.google.inject' , name : ' guice' , version : ' 4.2.2 '
13+ implementation group : ' com.google.inject' , name : ' guice' , version : ' 5.1.0 '
1414 implementation group : ' com.google.guava' , name : ' guava' , version : ' 31.0.1-jre'
1515 implementation group : ' com.moandjiezana.toml' , name : ' toml4j' , version : ' 0.7.2'
1616 implementation group : ' info.picocli' , name : ' picocli' , version : ' 4.1.4'
Original file line number Diff line number Diff line change @@ -67,11 +67,9 @@ public List<Injector> loadInjectors() throws ModuleLoadException {
6767
6868 private Module loadModule (String className , String jarPath ) throws ModuleLoadException {
6969 try {
70- URLClassLoader classLoader = (URLClassLoader ) Thread .currentThread ().getContextClassLoader ();
7170 URL jarUrl = new File (jarPath ).toURI ().toURL ();
72- Method method = URLClassLoader .class .getDeclaredMethod ("addURL" , URL .class );
73- method .setAccessible (true );
74- method .invoke (classLoader , jarUrl );
71+ URLClassLoader classLoader = new URLClassLoader (new URL [] { jarUrl }, Thread .currentThread ().getContextClassLoader ());
72+ Thread .currentThread ().setContextClassLoader (classLoader );
7573
7674 @ SuppressWarnings ("unchecked" )
7775 Class <Module > clazz = (Class <Module >) Class .forName (className , true , classLoader );
You can’t perform that action at this time.
0 commit comments