do not silently fail on plugin install with source files
This commit is contained in:
parent
63fdbe9b9b
commit
93a2742c84
|
@ -186,7 +186,7 @@ public class PluginManager {
|
||||||
if (FileSystemUtils.hasExtensions(extractLocation, ".java")) {
|
if (FileSystemUtils.hasExtensions(extractLocation, ".java")) {
|
||||||
debug("Plugin installation assumed to be site plugin, but contains source code, aborting installation...");
|
debug("Plugin installation assumed to be site plugin, but contains source code, aborting installation...");
|
||||||
FileSystemUtils.deleteRecursively(extractLocation);
|
FileSystemUtils.deleteRecursively(extractLocation);
|
||||||
return;
|
throw new IllegalArgumentException("Plugin installation assumed to be site plugin, but contains source code, aborting installation.");
|
||||||
}
|
}
|
||||||
|
|
||||||
File binFile = new File(extractLocation, "bin");
|
File binFile = new File(extractLocation, "bin");
|
||||||
|
|
|
@ -104,6 +104,13 @@ public class PluginManagerTests extends AbstractIntegrationTest {
|
||||||
assertPluginAvailable(nodeName, pluginName);
|
assertPluginAvailable(nodeName, pluginName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
public void testSitePluginWithSourceThrows() throws Exception {
|
||||||
|
String pluginName = "plugin-with-source";
|
||||||
|
URL url = PluginManagerTests.class.getResource("plugin_with_sourcefiles.zip");
|
||||||
|
downloadAndExtract(pluginName, "file://" + url.getFile());
|
||||||
|
}
|
||||||
|
|
||||||
private static PluginManager pluginManager(String pluginUrl) {
|
private static PluginManager pluginManager(String pluginUrl) {
|
||||||
Tuple<Settings, Environment> initialSettings = InternalSettingsPreparer.prepareSettings(
|
Tuple<Settings, Environment> initialSettings = InternalSettingsPreparer.prepareSettings(
|
||||||
ImmutableSettings.settingsBuilder().build(), false);
|
ImmutableSettings.settingsBuilder().build(), false);
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue