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

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

Hi,

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

  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 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:

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:

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