# Plugin fails with forbiddenapis:1.7:check

**URL:** <https://discuss.elastic.co/t/plugin-fails-with-forbiddenapis-1-7-check/61502>\
**Category:** Elasticsearch\
**Created:** [September 26, 2016, 11:09am UTC](https://discuss.elastic.co/t/plugin-fails-with-forbiddenapis-1-7-check/61502 "2016-09-26T11:09:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_muddu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@srikanth\_muddu](https://discuss.elastic.co/u/srikanth_muddu)\
**Post date:** [September 26, 2016, 11:09am UTC](https://discuss.elastic.co/t/plugin-fails-with-forbiddenapis-1-7-check/61502/1 "2016-09-26T11:09:09Z")

</div>

[INFO] Scanning for API signatures and dependencies...  
[ERROR] Forbidden class/interface/annotation use: java.nio.file.Paths [Use org.elasticsearch.common.io.PathUtils.get() instead.]  
[ERROR] in org.elasticsearch.common.io.PathUtils (PathUtils.java:75)  
[ERROR] Forbidden method invocation: org.elasticsearch.common.io.PathUtils#get(java.net.URI) [Don't try reading from paths that are not configured in Environment, resolve from Environment instead]  
[ERROR] in org.elasticsearch.common.io.PathUtils (PathUtils.java:101)  
[ERROR] Forbidden method invocation: java.nio.file.FileSystems#getDefault() [use org.elasticsearch.common.io.PathUtils.getDefaultFileSystem() instead.]  
[ERROR] in org.elasticsearch.common.io.PathUtils (PathUtils.java:44)  
[ERROR] Forbidden method invocation: org.apache.lucene.index.IndexReader#addReaderClosedListener(org.apache.lucene.index.IndexReader$ReaderClosedListener) [Close listeners can only installed via ElasticsearchDirectoryReader#addReaderCloseListener]  
[ERROR] in org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader (ElasticsearchDirectoryReader.java:88)  
[ERROR] Forbidden method invocation: java.lang.Math#abs(int) [Beware of the behavior of this method on MIN\_VALUE]  
[ERROR] in org.elasticsearch.common.math.UnboxedMathUtils (UnboxedMathUtils.java:463)  
[ERROR] Forbidden method invocation: java.lang.Math#abs(long) [Beware of the behavior of this method on MIN\_VALUE]  
[ERROR] in org.elasticsearch.common.math.UnboxedMathUtils (UnboxedMathUtils.java:468)  
[ERROR] Forbidden method invocation: org.apache.lucene.util.Version#parseLeniently(java.lang.String) [Use Lucene.parseLenient instead it strips off minor version]

many errors like this occurred ,,,

[INFO] ------------------------------------------------------------------------  
[INFO] Reactor Summary:  
[INFO]  
[INFO] Build Tools and Resources .......................... SUCCESS [0.620 s]  
[INFO] Rest API Specification ............................. SUCCESS [0.312 s]  
[INFO] Elasticsearch: Parent POM .......................... SUCCESS [5.387 s]  
[INFO] Elasticsearch: Core ................................ FAILURE [7.208 s]  
[INFO] Distribution: Parent POM ........................... SKIPPED

[INFO] ------------------------------------------------------------------------  
[INFO] BUILD FAILURE  
[INFO] ------------------------------------------------------------------------  
[INFO] Total time: 14.939 s  
[INFO] Finished at: 2016-09-26T06:00:15-05:00  
[INFO] Final Memory: 49M/378M  
[INFO] ------------------------------------------------------------------------  
[ERROR] Failed to execute goal de.thetaphi:forbiddenapis:1.7:check (check-forbidden-apis) on project elasticsearch: Check for forbidden API calls failed, see log. -\> [Help 1]  
[ERROR]  
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
[ERROR] Re-run Maven using the -X switch to enable full debug logging.  
[ERROR]

I am getting this error when I wanted to create a custom plugin .  
followed all the dir structure  
when I try to build it I get this error .

followed this link : [https://blog.iterativ.ch/2014/04/11/listindices-writing-your-first-elasticsearch-java-plugin/](https://blog.iterativ.ch/2014/04/11/listindices-writing-your-first-elasticsearch-java-plugin/)

please do help ...

---

<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:** [September 26, 2016, 1:04pm UTC](https://discuss.elastic.co/t/plugin-fails-with-forbiddenapis-1-7-check/61502/2 "2016-09-26T13:04:22Z")

</div>

Please format your code/logs.

Logs are telling you the details of what is wrong and often what you should do to fix.  
Just apply the suggestions.

---

<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:** [July 5, 2017, 10:17pm UTC](https://discuss.elastic.co/t/plugin-fails-with-forbiddenapis-1-7-check/61502/3 "2017-07-05T22:17:19Z")

</div>


