Skip to content

Commit db3174d

Browse files
committed
DATAES-289 - added groovy plugin for ES2.4
1 parent 896fbbe commit db3174d

File tree

6 files changed

+137
-10
lines changed

6 files changed

+137
-10
lines changed

pom.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,7 @@
8686
<artifactId>jackson-databind</artifactId>
8787
<version>${jackson}</version>
8888
</dependency>
89-
90-
<!-- Groovy -->
91-
<dependency>
92-
<groupId>org.codehaus.groovy</groupId>
93-
<artifactId>groovy-all</artifactId>
94-
<version>2.4.4</version>
95-
<scope>test</scope>
96-
</dependency>
97-
89+
9890
<!-- CDI -->
9991
<dependency>
10092
<groupId>javax.enterprise</groupId>

src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ public void shouldExecuteStringQuery() {
472472
}
473473

474474
@Test
475-
@Ignore
476475
public void shouldUseScriptedFields() {
477476
// given
478477
String documentId = randomNumeric(5);
Binary file not shown.
Binary file not shown.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Elasticsearch plugin descriptor file
2+
# This file must exist as 'plugin-descriptor.properties' at
3+
# the root directory of all plugins.
4+
#
5+
# A plugin can be 'site', 'jvm', or both.
6+
#
7+
### example site plugin for "foo":
8+
#
9+
# foo.zip <-- zip file for the plugin, with this structure:
10+
# _site/ <-- the contents that will be served
11+
# plugin-descriptor.properties <-- example contents below:
12+
#
13+
# site=true
14+
# description=My cool plugin
15+
# version=1.0
16+
#
17+
### example jvm plugin for "foo"
18+
#
19+
# foo.zip <-- zip file for the plugin, with this structure:
20+
# <arbitrary name1>.jar <-- classes, resources, dependencies
21+
# <arbitrary nameN>.jar <-- any number of jars
22+
# plugin-descriptor.properties <-- example contents below:
23+
#
24+
# jvm=true
25+
# classname=foo.bar.BazPlugin
26+
# description=My cool plugin
27+
# version=2.0.0-rc1
28+
# elasticsearch.version=2.0
29+
# java.version=1.7
30+
#
31+
### mandatory elements for all plugins:
32+
#
33+
# 'description': simple summary of the plugin
34+
description=Groovy scripting integration for Elasticsearch
35+
#
36+
# 'version': plugin's version
37+
version=2.4.0
38+
#
39+
# 'name': the plugin name
40+
name=lang-groovy
41+
42+
### mandatory elements for site plugins:
43+
#
44+
# 'site': set to true to indicate contents of the _site/
45+
# directory in the root of the plugin should be served.
46+
site=false
47+
#
48+
### mandatory elements for jvm plugins :
49+
#
50+
# 'jvm': true if the 'classname' class should be loaded
51+
# from jar files in the root directory of the plugin.
52+
# Note that only jar files in the root directory are
53+
# added to the classpath for the plugin! If you need
54+
# other resources, package them into a resources jar.
55+
jvm=true
56+
#
57+
# 'classname': the name of the class to load, fully-qualified.
58+
classname=org.elasticsearch.script.groovy.GroovyPlugin
59+
#
60+
# 'java.version' version of java the code is built against
61+
# use the system property java.specification.version
62+
# version string must be a sequence of nonnegative decimal integers
63+
# separated by "."'s and may have leading zeros
64+
java.version=1.7
65+
#
66+
# 'elasticsearch.version' version of elasticsearch compiled against
67+
# You will have to release a new version of the plugin for each new
68+
# elasticsearch release. This version is checked when the plugin
69+
# is loaded so Elasticsearch will refuse to start in the presence of
70+
# plugins with the incorrect elasticsearch.version.
71+
elasticsearch.version=2.4.0
72+
#
73+
### deprecated elements for jvm plugins :
74+
#
75+
# 'isolated': true if the plugin should have its own classloader.
76+
# passing false is deprecated, and only intended to support plugins
77+
# that have hard dependencies against each other. If this is
78+
# not specified, then the plugin is isolated by default.
79+
isolated=true
80+
#
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
grant {
21+
// needed to generate runtime classes
22+
permission java.lang.RuntimePermission "createClassLoader";
23+
// needed by IndyInterface
24+
permission java.lang.RuntimePermission "getClassLoader";
25+
// needed by groovy engine
26+
permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
27+
// Allow executing groovy scripts with codesource of /untrusted
28+
permission groovy.security.GroovyCodeSourcePermission "/untrusted";
29+
30+
// Standard set of classes
31+
permission org.elasticsearch.script.ClassPermission "<<STANDARD>>";
32+
// groovy runtime (TODO: clean these up if possible)
33+
permission org.elasticsearch.script.ClassPermission "groovy.grape.GrabAnnotationTransformation";
34+
permission org.elasticsearch.script.ClassPermission "groovy.json.JsonOutput";
35+
permission org.elasticsearch.script.ClassPermission "groovy.lang.Binding";
36+
permission org.elasticsearch.script.ClassPermission "groovy.lang.GroovyObject";
37+
permission org.elasticsearch.script.ClassPermission "groovy.lang.GString";
38+
permission org.elasticsearch.script.ClassPermission "groovy.lang.Script";
39+
permission org.elasticsearch.script.ClassPermission "groovy.util.GroovyCollections";
40+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.ast.builder.AstBuilderTransformation";
41+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.reflection.ClassInfo";
42+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.GStringImpl";
43+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.powerassert.ValueRecorder";
44+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.powerassert.AssertionRenderer";
45+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.ScriptBytecodeAdapter";
46+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation";
47+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.vmplugin.v7.IndyInterface";
48+
permission org.elasticsearch.script.ClassPermission "sun.reflect.ConstructorAccessorImpl";
49+
permission org.elasticsearch.script.ClassPermission "sun.reflect.MethodAccessorImpl";
50+
51+
permission org.elasticsearch.script.ClassPermission "groovy.lang.Closure";
52+
permission org.elasticsearch.script.ClassPermission "org.codehaus.groovy.runtime.GeneratedClosure";
53+
permission org.elasticsearch.script.ClassPermission "groovy.lang.MetaClass";
54+
permission org.elasticsearch.script.ClassPermission "groovy.lang.Range";
55+
permission org.elasticsearch.script.ClassPermission "groovy.lang.Reference";
56+
};

0 commit comments

Comments
 (0)