# Unable to build elasticsearch from source on mac: Could not set unknown property 'excludes'

**URL:** <https://discuss.elastic.co/t/unable-to-build-elasticsearch-from-source-on-mac-could-not-set-unknown-property-excludes/191394>\
**Category:** Elasticsearch\
**Created:** [July 19, 2019, 12:50pm UTC](https://discuss.elastic.co/t/unable-to-build-elasticsearch-from-source-on-mac-could-not-set-unknown-property-excludes/191394 "2019-07-19T12:50:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkoothrappahli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nkoothrappahli/32/31959_2.png) [@nkoothrappahli](https://discuss.elastic.co/u/nkoothrappahli)\
**Post date:** [July 19, 2019, 12:50pm UTC](https://discuss.elastic.co/t/unable-to-build-elasticsearch-from-source-on-mac-could-not-set-unknown-property-excludes/191394/1 "2019-07-19T12:50:48Z")

</div>

```
git checkout v7.2.0
HEAD ist jetzt bei 508c38a450a Mute DieWithDignityIT test. (#43415)

./gradlew run

> Configure project :benchmarks
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version : 5.4.1
  OS Info : Mac OS X 10.13.6 (x86_64)
  JDK Version : 12 (Oracle Corporation 12.0.1 [OpenJDK 64-Bit Server VM 12.0.1+12])
  JAVA_HOME : /Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk/Contents/Home
  Random Testing Seed : BE7EFC6EF653D6EF
=======================================

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/es/elasticsearch/libs/core/bin/build.gradle' line: 108

* What went wrong:
A problem occurred evaluating project ':libs:core:bin'.
> Could not set unknown property 'excludes' for task ':libs:core:bin:thirdPartyAudit' of type org.elasticsearch.gradle.precommit.ThirdPartyAuditTask.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
```

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [July 26, 2019, 9:44am UTC](https://discuss.elastic.co/t/unable-to-build-elasticsearch-from-source-on-mac-could-not-set-unknown-property-excludes/191394/2 "2019-07-26T09:44:05Z")

</div>

Hi,

I just tried to reproduce this on the very same commit (i.e. `508c38a450a`) with the same configuration as you:

```auto
  Gradle Version : 5.4.1
  OS Info : Mac OS X 10.13.6 (x86_64)
  JDK Version : 12 (Oracle Corporation 12.0.1 [OpenJDK 64-Bit Server VM 12.0.1+12])
  JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home

```

The build went fine for me. Our [development setup docs](https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md#contributing-to-the-elasticsearch-codebase) mention to define also `JAVA8_HOME` ... `JAVA11_HOME` and I suspected that this is the cause so I've removed all related environment variables until I was left with this:

```auto
daniel@io:7/elasticsearch ‹508c38a450a›$ env | grep "JAVA.*HOME"
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
RUNTIME_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
JAVA12_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home

```

Running either `./gradlew clean` or `./gradlew run` still works fine for me.

What's odd is this here in your output:

```auto
Build file '/Users/es/elasticsearch/libs/core/bin/build.gradle' line: 108

```

That file does not exist for me. So I wonder whether you have uncommitted changes or other leftovers in your checkout. You can check this with `git status`. You can tell git to remove untracked files from your working tree with `git clean -xdf`. WARNING(!): This will **delete** all uncommitted files so proceed with caution if you have uncomitted changes). Alternatively you can also try with a fresh checkout in a different directory.

Daniel

---

<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 23, 2019, 9:44am UTC](https://discuss.elastic.co/t/unable-to-build-elasticsearch-from-source-on-mac-could-not-set-unknown-property-excludes/191394/3 "2019-08-23T09:44:06Z")

</div>

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