# Errors on gradle build using elasticsearch.esplugin

**URL:** <https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393>\
**Category:** Elasticsearch\
**Created:** [July 9, 2017, 1:02pm UTC](https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393 "2017-07-09T13:02:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [July 9, 2017, 1:02pm UTC](https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393/1 "2017-07-09T13:02:17Z")

</div>

I'm working on moving a plugin to use gradle the the elasticsearch.esplugin gradle plugin, and have a few issues while getting the import done.

1. Running tests via AnalysisFactoryTestCase fails with the following:

```nohighlight
   > Throwable #1: java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.analysis.util.TokenizerFactory with name 'hebrew' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [keyword, letter, lowercase, whitespace, edgengram, ngram, pathhierarchy, pattern, simplepatternsplit, simplepattern, classic, standard, uax29urlemail, thai, wikipedia]
   > at __randomizedtesting.SeedInfo.seed([7DFF65EA60B49884:6DA8CD1B875C5B5B]:0)
   > at org.apache.lucene.analysis.util.AnalysisSPILoader.lookupClass(AnalysisSPILoader.java:125)
   > at org.apache.lucene.analysis.util.TokenizerFactory.lookupClass(TokenizerFactory.java:43)
   > at org.elasticsearch.AnalysisFactoryTestCase.testMultiTermAware(AnalysisFactoryTestCase.java:386)

```

The plugin works perfect in production, so this seems like a missing configuration on the tests level - but I'm not sure which?

1. Running gradle build, task test fails with the following error that seems to be out of my control:

```nohighlight
Exception thrown by subscriber method onHeartbeat(com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent) on subscriber com.carrotsearch.gradle.junit4.TestReportLogger@7157892 when dispatching event: com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent@29c92971
java.lang.NullPointerException
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo.getPidString(ForkedJvmInfo.java:85)
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo$getPidString.call(Unknown Source)
        at com.carrotsearch.gradle.junit4.TestReportLogger.onHeartbeat(TestReportLogger.groovy:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.slowHeartBeat(AggregatingListener.java:76)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$3.run(LocalSlaveStreamHandler.java:149)

```

1. Adding a project license for the license headers check doesn't seem to work. I have a call to `licenseHeaders { additionalLicense ... }` in my `build.gradle` file but the check still fails so looks like the call to the additionalLicense method isn't making a difference (and I also couldn't find any examples of plugins using it).

The plugin is here: [https://github.com/synhershko/elasticsearch-analysis-hebrew](https://github.com/synhershko/elasticsearch-analysis-hebrew)

Hoping it's something simple I missed 🙂

Thanks,

Itamar

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [July 19, 2017, 6:42pm UTC](https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393/2 "2017-07-19T18:42:40Z")

</div>

The heartbeat issue was a test framework issue, fixed [here](https://github.com/randomizedtesting/randomizedtesting/commit/6934e2f633a1a2dc7ed4b882767bf81f372e4218).

How are you using `additionalLicense`? It takes 3 arguments, a "category name", a more general "family name", and a substring to search for. Also note that `additionalLicense` simply _defines_ an additional license type. You also need to set it as (or add it to) the approved licenses. For example:

```auto
licenseHeaders {
    additionalLicense 'ABC', 'The ABC License', 'ABC 123, you have a license from me'
    approvedLicenses = ['The ABC License']
}

```

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [July 19, 2017, 7:01pm UTC](https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393/3 "2017-07-19T19:01:29Z")

</div>

I didn't add it to `approvedLicenses`, that was it, thanks!

Any idea re the SPI issue with AnalysisFactoryTestCase ?

And are there known issues with Gradle 3 and 4 with the esplugin on ES \< 5.4? I'm getting a gradle build error when trying it with 5.0-5.3.

Thanks!

---

<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:** [August 16, 2017, 7:01pm UTC](https://discuss.elastic.co/t/errors-on-gradle-build-using-elasticsearch-esplugin/92393/4 "2017-08-16T19:01:35Z")

</div>

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