Integration Testing for a Custom Plugin - Security Policy Issue

OS: Mac OS 10.13.6
JDK: 1.8.0_191
Elasticsearch: 6.5.4
Dependencies management: Maven 3.6.0

I 've developed a Custom ES plugin with custom security policy, so I added the plugin-security.policy file wich containing thegrant statements for my additional permissions:

grant {
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  permission java.lang.RuntimePermission "getClassLoader";
  permission java.lang.RuntimePermission "setContextClassLoader";
  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
  permission org.hibernate.validator.HibernateValidatorPermission "accessPrivateMembers";
  permission "<<ALL FILES>>", "read,write,delete";

So far, my plugin runs greatly within an Elasticsearch instance.

Now I want to add integrations test for my plugin, so I integrate the elasticsearch-test framework and I loaded the plugin as mentioned here:,

After following those extra developement steps (, I'm getting this Exception:

Caused by: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
	at java.lang.SecurityManager.checkPermission(
	at java.lang.Class.checkMemberAccess(

So, I guess that my security-policy file which is placed at src/main/resources/plugin-metadata, is not loaded at the test stage...
Can anyone, help me on how I include the security-policy file while testing?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.