# Cannot execute plugin with maven elastic as a dependency from an IDE

**URL:** <https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930>\
**Category:** Elasticsearch\
**Created:** [January 26, 2017, 5:16pm UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930 "2017-01-26T17:16:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)\
**Post date:** [January 26, 2017, 5:16pm UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/1 "2017-01-26T17:16:27Z")

</div>

Hi,

I'm trying to set up debug environment for elastic search plugin development in the Intellij IDEA IDE. To do that I've created maven project with the dependencies from elastic search, jna, log4j-api and log4j-core and execution configuration, that has following startup parameters:

-Des.path.home="C:\Users\vglazkov\Documents\Projects\Java\elasticsearch-5.1.2"  
-Xms2g  
-Xmx2g  
-XX:+UseConcMarkSweepGC  
-XX:CMSInitiatingOccupancyFraction=75  
-XX:+UseCMSInitiatingOccupancyOnly  
-XX:+DisableExplicitGC  
-XX:+AlwaysPreTouch  
-server -Xss1m  
-Djava.awt.headless=true  
-Dfile.encoding=UTF-8  
-Djna.nosys=true  
-Djdk.io.permissionsUseCanonicalPath=true  
-Dio.netty.noUnsafe=true  
-Dio.netty.noKeySetOptimization=true  
-Dio.netty.recycler.maxCapacityPerThread=0  
-Dlog4j.shutdownHookEnabled=false  
-Dlog4j2.disable.jmx=true  
-Dlog4j.skipJansi=true  
-XX:+HeapDumpOnOutOfMemoryError  
-Des.foreground=yes

that I've copied from the jvm.config file of the production instance of Elastic. I've also copied in the es.path.home copy of the config directory from the production instance of Elastic. Startup class setups in the pom.xml like this one:

```
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
    <mainClass>org.elasticsearch.bootstrap.Elasticsearch</mainClass>
</configuration>

```

All goes fine, until I'm getting the following exception:  
`java.security.AccessControlException: access denied ("java.io.FilePermission" "\C:\Users\vglazkov\.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.8.1\jackson-dataformat-smile-2.8.1.jar" "read")`

I've checked that this file exists on my disk. Why is this happening and how can I fix this problem?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 26, 2017, 6:12pm UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/2 "2017-01-26T18:12:22Z")

</div>

Running elasticsearch like this (from a Java app) is not supported anymore.

See [https://www.elastic.co/blog/elasticsearch-the-server](https://www.elastic.co/blog/elasticsearch-the-server)

You have a maven plugin for elasticsearch [https://github.com/alexcojocaru/elasticsearch-maven-plugin](https://github.com/alexcojocaru/elasticsearch-maven-plugin)

Or you can do it my way (I'm planning to switch may be to maven plugin though): [http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/](http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/)

---

<div class="post-metadata">

**Author:** ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)\
**Post date:** [January 26, 2017, 9:19pm UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/3 "2017-01-26T21:19:19Z")

</div>

Hi, David!

Thanks for the quick answer! I've tried your second solution before this one - your blog was very helpful for me - I've configured working system, but there is one main problem for me - I can execute tests and stop on breakpoints inside my integration tests but I can't stop on breakpoints inside plugin. How I do that?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 26, 2017, 10:01pm UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/4 "2017-01-26T22:01:08Z")

</div>

I believe you can slightly modify how elasticsearch starts and activate remote debugging:

```
ES_JAVA_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y" ./bin/elasticsearch

```

Then attach your IDE to the process.

HTH

---

<div class="post-metadata">

**Author:** ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)\
**Post date:** [January 27, 2017, 11:28am UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/5 "2017-01-27T11:28:09Z")

</div>

Great thanks, David!

For someone who will be developing plugin on Windows the equivalent command will be:

```auto
cmd /V /C "set ES_JAVA_OPTS=-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y && bin\elasticsearch.bat"

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 27, 2017, 11:41am UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/6 "2017-01-27T11:41:22Z")

</div>

Great!

Would you like to modify [this document](https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#debugging-remotely-from-an-ide) and add this command line for windows users as well?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 24, 2017, 11:41am UTC](https://discuss.elastic.co/t/cannot-execute-plugin-with-maven-elastic-as-a-dependency-from-an-ide/72930/7 "2017-02-24T11:41:33Z")

</div>

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