Skip to content

Commit 8adcd30

Browse files
committed
Build: Move plugin cli and tests to distribution tool (#24220)
The plugin cli currently resides inside the elasticsearch jar. This commit moves it into a plugin-cli jar. This is change alone is a no-op; it does not change anything about what is loaded at runtime. But it will allow easier testing (with fixtures in the future to test ES or maven installation), as well as eventually not loading these classes when starting elasticsearch.
1 parent 734a3fc commit 8adcd30

File tree

13 files changed

+35
-2
lines changed

13 files changed

+35
-2
lines changed

core/src/main/java/org/elasticsearch/plugins/PluginSecurity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.apache.lucene.util.IOUtils;
2323
import org.elasticsearch.cli.Terminal;
2424
import org.elasticsearch.cli.Terminal.Verbosity;
25-
import org.elasticsearch.env.Environment;
2625

2726
import java.io.IOException;
2827
import java.nio.file.Files;

distribution/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ configure(distributions) {
164164
from project(':core').configurations.runtime
165165
// delay add tools using closures, since they have not yet been configured, so no jar task exists yet
166166
from { project(':distribution:tools:java-version-checker').jar }
167+
from { project(':distribution:tools:plugin-cli').jar }
167168
}
168169

169170
modulesFiles = copySpec {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
apply plugin: 'elasticsearch.build'
21+
22+
dependencies {
23+
provided "org.elasticsearch:elasticsearch:${version}"
24+
testCompile "org.elasticsearch.test:framework:${version}"
25+
testCompile 'com.google.jimfs:jimfs:1.1'
26+
testCompile 'com.google.guava:guava:18.0'
27+
}
28+
29+
test {
30+
// TODO: find a way to add permissions for the tests in this module
31+
systemProperty 'tests.security.manager', 'false'
32+
}

core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java renamed to distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import org.apache.lucene.util.IOUtils;
2727
import org.elasticsearch.Version;
2828
import org.elasticsearch.bootstrap.JarHell;
29-
import org.elasticsearch.cli.ExitCodes;
3029
import org.elasticsearch.cli.EnvironmentAwareCommand;
30+
import org.elasticsearch.cli.ExitCodes;
3131
import org.elasticsearch.cli.Terminal;
3232
import org.elasticsearch.cli.UserException;
3333
import org.elasticsearch.common.collect.Tuple;

0 commit comments

Comments
 (0)