diff --git a/watcher/.settings/org.eclipse.core.resources.prefs b/watcher/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..6fd0a9aab13 --- /dev/null +++ b/watcher/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 \ No newline at end of file diff --git a/watcher/.settings/org.eclipse.jdt.core.prefs b/watcher/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..aefac3b3626 --- /dev/null +++ b/watcher/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,18 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.lineSplit=140 +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 \ No newline at end of file diff --git a/watcher/.settings/org.eclipse.jdt.ui.prefs b/watcher/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..a42667f8698 --- /dev/null +++ b/watcher/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +formatter_settings_version=12 +# Intellij IDEA import order +org.eclipse.jdt.ui.importorder=;com;org;java;javax;\#; +# License header +org.eclipse.jdt.ui.text.custom_code_templates= \ No newline at end of file diff --git a/watcher/pom.xml b/watcher/pom.xml index 1eda109a84c..0de710ad75a 100644 --- a/watcher/pom.xml +++ b/watcher/pom.xml @@ -16,6 +16,8 @@ + + ${basedir}/src/main/assemblies/plugin.xml org.elasticsearch.watcher.WatcherPlugin false diff --git a/watcher/src/main/assemblies/plugin.xml b/watcher/src/main/assemblies/plugin.xml new file mode 100644 index 00000000000..db07b214b22 --- /dev/null +++ b/watcher/src/main/assemblies/plugin.xml @@ -0,0 +1,49 @@ + + + plugin + + zip + + false + + + false + bin/watcher + bin + + + + + / + true + true + + org.elasticsearch:elasticsearch + + + + / + false + + com.sun.mail:javax.mail + javax.activation:activation + com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer + + + + + + ${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties + + true + + + LICENSE.txt + / + + + NOTICE.txt + / + + + diff --git a/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java b/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java index 9efdeeffc8c..315ecb56b34 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java @@ -39,7 +39,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest { return Settings.settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) .put("plugin.types", WatcherPlugin.class.getName() + "," + LicensePlugin.class.getName()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put(WatcherPlugin.ENABLED_SETTING, false) .put(Node.HTTP_ENABLED, true) .build(); @@ -49,7 +48,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest { protected Settings transportClientSettings() { return Settings.builder() .put(super.transportClientSettings()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java b/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java index 0adcd82e86b..8a43eafa0c5 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/actions/index/IndexActionTests.java @@ -51,7 +51,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } @@ -59,7 +58,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest { protected Settings transportClientSettings() { return Settings.builder() .put(super.transportClientSettings()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java b/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java index 0a1baa0e74c..8eb87fc94f7 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/input/search/SearchInputTests.java @@ -95,7 +95,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest { //Set path so ScriptService will pick up the test scripts return settingsBuilder().put(super.nodeSettings(nodeOrdinal)) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put("path.conf", configPath).build(); } @@ -103,7 +102,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest { protected Settings transportClientSettings() { return Settings.builder() .put(super.transportClientSettings()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java b/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java index 90cb829a15d..1393d17ee6b 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/shield/BasicShieldTests.java @@ -45,7 +45,6 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTests { .put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName()) // Use just the transport user here, so we can test Watcher roles specifically .put("shield.user", "transport_client:changeme") - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java index 1948f046daf..3115dcc927d 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/AbstractWatcherIntegrationTests.java @@ -114,7 +114,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg .put("scroll.size", randomIntBetween(1, 100)) .put("plugin.types", Strings.collectionToCommaDelimitedString(pluginTypes())) .put(ShieldSettings.settings(shieldEnabled)) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put("watcher.trigger.schedule.engine", scheduleImplName) .build(); } @@ -199,7 +198,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg if (shieldEnabled == false) { return Settings.builder() .put(super.transportClientSettings()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put("plugin.types", WatcherPlugin.class.getName()) .build(); } @@ -207,7 +205,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg return Settings.builder() .put("client.transport.sniff", false) .put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put("shield.user", "admin:changeme") .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java b/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java index 44e1ff3cdf4..d2d41f6a9f0 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/test/rest/WatcherRestTests.java @@ -63,7 +63,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase { + "," + licensePluginClass().getName()) .put(Node.HTTP_ENABLED, true) .put(ShieldSettings.settings(shieldEnabled)) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } @@ -81,7 +80,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase { String token = basicAuthHeaderValue("admin", new SecuredString("changeme".toCharArray())); return Settings.builder() .put(Headers.PREFIX + ".Authorization", token) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } else { return Settings.EMPTY; @@ -98,7 +96,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase { + (shieldEnabled ? ShieldPlugin.class.getName() + "," : "")) .put("shield.user", "admin:changeme") .put(Node.HTTP_ENABLED, true) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } @@ -107,7 +104,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase { .put(Node.HTTP_ENABLED, true) .put("plugin.types", WatcherPlugin.class.getName() + "," + "," + LicensePlugin.class.getName()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); } diff --git a/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java b/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java index b41448799a5..46678b98cfd 100644 --- a/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java +++ b/watcher/src/test/java/org/elasticsearch/watcher/transform/search/SearchTransformTests.java @@ -95,7 +95,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest { return settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) // we're not extending from the base watcher test case, so we should prevent the watcher plugin from being loaded - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .put("path.conf", configPath).build(); } @@ -103,7 +102,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest { protected Settings transportClientSettings() { return Settings.builder() .put(super.transportClientSettings()) - .put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) .build(); }