]> jfr.im git - irc/rizon/acid.git/commitdiff
If plugin jar can not be found, use the class files in target/classes
authorAdam <redacted>
Wed, 26 Nov 2014 19:26:14 +0000 (14:26 -0500)
committerAdam <redacted>
Wed, 26 Nov 2014 19:26:14 +0000 (14:26 -0500)
acid/src/main/java/net/rizon/acid/util/ClassLoader.java

index dbc061b17d5c47e83f75ed813f9fcd898ce5c480..0fc1508a5c40b05cee4581f84a5e79543b287900 100644 (file)
@@ -60,7 +60,22 @@ public final class ClassLoader extends URLClassLoader
 
                        if (jar == null)
                        {
-                               log.log(Level.WARNING, "Unable to find plugin JAR in " + pluginPath + "/target/.");
+                               File f = new File(targetFolder, "classes/");
+                               if (!f.isDirectory())
+                               {
+                                       log.log(Level.WARNING, "Unable to locate plugin JAR/class files for " + plugin);
+                                       return;
+                               }
+
+                               log.log(Level.FINE, "Using classes/ for plugin " + plugin);
+                               try
+                               {
+                                       this.addURL(f.toURI().toURL());
+                               }
+                               catch (MalformedURLException ex)
+                               {
+                                       log.log(Level.WARNING, "Unable to add class URL for " + plugin + " [" + f.toURI() + "]", ex);
+                               }
                                return;
                        }
                        else