From f123785d342e33c8888b8b3387bbf6f0cf0351ea Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 1 Dec 2017 12:42:09 +0000 Subject: [PATCH] Add note on how to avoid Jar Hell in IntelliJ 2017.3 to contributing guide (#27614) When running unit tests direct from the IDE this setting change is needed in addition to the idea.no.launcher property that previous versions of IntelliJ needed. --- CONTRIBUTING.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc0d2ba6e35..a0655b4b849 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,17 +110,20 @@ IntelliJ users can automatically configure their IDE: `gradle idea` then `File->New Project From Existing Sources`. Point to the root of the source directory, select `Import project from external model->Gradle`, enable -`Use auto-import`. Additionally, in order to run tests directly from +`Use auto-import`. In order to run tests directly from IDEA 2017.2 and above it is required to disable IDEA run launcher to avoid finding yourself in "jar hell", which can be achieved by adding the `-Didea.no.launcher=true` [JVM option](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties) or by adding `idea.no.launcher=true` to the -`idea.properties`[https://www.jetbrains.com/help/idea/file-idea-properties.html] +[`idea.properties`](https://www.jetbrains.com/help/idea/file-idea-properties.html) file which can be accessed under Help > Edit Custom Properties within IDEA. You may also need to [remove `ant-javafx.jar` from your -classpath][https://github.com/elastic/elasticsearch/issues/14348] if that is -reported as a source of jar hell. +classpath](https://github.com/elastic/elasticsearch/issues/14348) if that is +reported as a source of jar hell. Additionally, in order to run tests directly +from IDEA 2017.3 and above, go to `Run->Edit Configurations...` and change the +value for the `Shorten command line` setting from `user-local default: none` to +`classpath file`. The Elasticsearch codebase makes heavy use of Java `assert`s and the test runner requires that assertions be enabled within the JVM. This