# Elasticsearch 8.5.1 Won't Build. Failed to Apply SpotlessPlugin

**URL:** <https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476>\
**Category:** Elasticsearch\
**Created:** [February 1, 2023, 8:38pm UTC](https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476 "2023-02-01T20:38:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alxdaly](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@alxdaly](https://discuss.elastic.co/u/alxdaly)\
**Post date:** [February 1, 2023, 8:38pm UTC](https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476/1 "2023-02-01T20:38:20Z")

</div>

I am trying to build an instance of elasticsearch 8.5.1 in a linux environment. I have had to modify the gradle files to point to my company's artifact repositories. When I try to run any ./gradlew commands, I get the error below.

```auto
Build file '../elasticsearch-8.5.1/build-tools/build.gradle' line: 17

* What went wrong:
An exception occurred applying plugin request [id: 'elasticsearch.formatting']
> Failed to apply plugin class 'com.diffplug.gradle.spotless.SpotlessPlugin'.
   > Could not create an instance of type com.diffplug.gradle.spotless.SpotlessExtensionImpl.
      > Could not generate a decorated class for type SpotlessExtensionImpl.
         > com/diffplug/spotless/LineEnding

```

I've checked that spotless-plugin-gradle-6.7.2 is available in the repositories. Not sure why it is failing. Any help in figuring this out would be appreciated.

---

<div class="post-metadata">

**Author:** ![alxdaly](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@alxdaly](https://discuss.elastic.co/u/alxdaly)\
**Post date:** [February 7, 2023, 2:07pm UTC](https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476/2 "2023-02-07T14:07:36Z")

</div>

The only file I have modified are the settings.gradle files in the root diretory, build-tools, and build-conventions and the build.gradle files in build-tools, build-tools-internal, and build-conventions. I only pointed the repositories to my internal maven repositories. I haven't changed anything else.

---

<div class="post-metadata">

**Author:** ![alxdaly](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@alxdaly](https://discuss.elastic.co/u/alxdaly)\
**Post date:** [February 8, 2023, 5:07pm UTC](https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476/3 "2023-02-08T17:07:27Z")

</div>

The problem was that I had set the metadata source as artifact for one of the repositories that I shouldn't have. Removing that fixed the issue.

---

<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:** [March 8, 2023, 5:07pm UTC](https://discuss.elastic.co/t/elasticsearch-8-5-1-wont-build-failed-to-apply-spotlessplugin/324476/4 "2023-03-08T17:07:46Z")

</div>

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