Skip to content

Commit 916dd17

Browse files
committed
Fix issue when executing using gradle
1 parent 9f7cb6d commit 916dd17

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

core/src/main/java/org/polypheny/db/plugins/PolyPluginManager.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public class PolyPluginManager extends DefaultPluginManager {
9090

9191
static {
9292
final File jarFile = new File( PolyPluginManager.class.getProtectionDomain().getCodeSource().getLocation().getPath() );
93+
File pluginsFolder = PolyphenyHomeDirManager.getInstance().registerNewFolder( "plugins" );
9394
if ( jarFile.isFile() ) { // Run with JAR file
94-
File pluginsFolder = PolyphenyHomeDirManager.getInstance().registerNewFolder( "plugins" );
9595
try {
9696
final JarFile jar = new JarFile( jarFile );
9797
final Enumeration<JarEntry> entries = jar.entries();
@@ -104,16 +104,14 @@ public class PolyPluginManager extends DefaultPluginManager {
104104
}
105105
jar.close();
106106
} catch ( Exception e ) {
107-
// Ignore
107+
// ignore
108108
}
109-
pluginManager = new PolyPluginManager( Path.of( pluginsFolder.getPath() ) );
110-
} else {
111-
pluginManager = new PolyPluginManager(
112-
Path.of( PolyphenyHomeDirManager.getInstance().registerNewFolder( "plugins" ).getPath() ),
113-
Path.of( "../build/plugins" ),
114-
Path.of( "./build/plugins" ),
115-
Path.of( "../../build/plugins" ) );
116109
}
110+
pluginManager = new PolyPluginManager(
111+
Path.of( PolyphenyHomeDirManager.getInstance().registerNewFolder( "plugins" ).getPath() ),
112+
Path.of( "../build/plugins" ),
113+
Path.of( "./build/plugins" ),
114+
Path.of( "../../build/plugins" ) );
117115
}
118116

119117

@@ -156,7 +154,6 @@ public static void init( boolean resetPluginsOnStartup ) {
156154
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();
157155
for ( PluginWrapper plugin : startedPlugins ) {
158156
String pluginId = plugin.getDescriptor().getPluginId();
159-
160157
log.info( String.format( "Plugin '%s' added", pluginId ) );
161158
}
162159
}

0 commit comments

Comments
 (0)