Code Contribution - cannot import into IntelliJ

Hello everyone,

I wanted to contribute to Elastic project. I did read CONTRIBUTING.md and followed it both on Ubuntu 20.04 (in VirtualBox) and on Windows 10.

Ubuntu 20.04:
Importing project into IntelliJ (version 2021.1.1 Community Edition) doesn't end with an error, but there are compliation errors almost in every single build.gradle files on import xyz.xyz lines (example - Cannot resolve symbol 'ForbiddenApisPlugin').

Affected imports are from almost every package but org.gradle.*, java.*.

Trying to run app from terminal with ./gradlew :run works perfectly fine. Problem is only in IntelliJ.

What I did to try to solve it:

  • I did remove JDK from Project Settings and readded it (it's named 15, and it's OpenJDK's release of Java 15)
  • invalidate caches in IntelliJ
  • manually clear ~/.gradle/cache folder
  • Reload Gradle Project in IntelliJ
  • Reload All Gradle Projects in IntelliJ
  • Refresh Gradle Dependencies in IntelliJ
  • ./gradlew clean :run
  • I tried both Gradle runtimes - Specified location (which is version 7.0.2) and 'gradle-wrapper.properties' file in IntelliJ
  • for Gradle JVM I tried both version 15 and 16 (yes, it should be 15 only, but I did it, because maybe... :wink: )
  • git clean -xfd and importing project many times, not only with File/Open... pointing to build.gradle, but in a few other ways as well

Windows 10:
Out of curiosity I tried importing it into IntelliJ on Windows. Importing fails with message:

Build file 'D:\elasticsearch\build.gradle' line: 31

Plugin [id: 'elasticsearch.docker-support'] was not found in any of the following sources:

* 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.

I tried to gradlew.bat :run it in CLI, but it ended with the same error:

D:\elasticsearch
elasticsearch>gradle clean :run

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\elasticsearch\build.gradle' line: 31

* What went wrong:
Plugin [id: 'elasticsearch.docker-support'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)

* 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

BUILD FAILED in 9s

I mainly work on Ubuntu, so I invested more time into fixing it than the Windows version. But, to be honest, I kinda ran out of ideas.

Does anyone have an idea how to fix it? Or maybe ran into similar problem?

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