Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Start here if you are setting up a brand new development environment, or want to reconfigure your environment from scratch.

Requirements:

The instructions below assume you already have available:

  • A recent version of IntelliJ. These steps have been validated on IntelliJ 2020.2.2

  • JDK 1.8 installed and configured in IntelliJ

  • A local git clone of the apache/beam repository in your home directory ("~/beam")

  • ChromeDriver installed and running (chromedriver --port=4444)
  • Flutter installed
  • Dart installed (version >=3.0.2 <4.0.0)
  • The script local-env-setup.sh (Located at the root of the project)ran before importing the project

To set up your IntelliJ project:

  • Launch the New Project wizard by closing your project File | Close Project.
  • Then click Open from the splash page to open a new project (Depending on what version of IntelliJ you may need to find an option to "Import project" instead)
  • Select the settings.gradle.kts in the root of your beam git repo

...

You may also want to setup a specialized environment for the Beam modules you're working on:

Children Display


Make sure to set the formatting options. Otherwise IntelliJ will make unnecessary changes.

File → Settings → Editor → Code Style → Java → Tabs and Indents

Make sure the settings match below:

Image Added

Also disable "*" style imports

File → Settings → Editor → Code Style → Java → Imports

Set Class count to use import with '*'; to 999

Set Names count to use static import with '*'; to 999


Image Added

Issues when building:

When building the project with IntelliJ, you may encounter some issues, here is the fix for each issue:

Flutter finished with non-zero exit value 1:

Image Added

When you get this issue, you should make sure that ChromeDriver is installed and running with the command chromedriver --port=4444 and duplicate or rename the file config.example.dart to config.g.dart in the folder playground/frontend/lib.

If you want to see exactly what cause the issue, you can ran just the task that failed. For this example, you could ran the task as the following:  ./gradlew integrationTest_standalone_change_example_sdk_run and see the error message.

If you got as an error message the following, then you should only rename the file config.example.dart to config.g.dart

Image Added

If you got this error message, then you should run ChromeDriver with the following command chromedriver --port=4444

Info
titleChromeDriver

Note: You should keep ChromeDriver running until the build is finished.

Image Added

Cannot find symbol class Module:

if you got this error, you can try following solutions:

  1. Make sure to set the language as the following screen shot (The class Module is only available starting from Java 9+) 
    Image Added
  2. Clean & rebuild the project
  3. Try invalidating the IntelliJ cache and restarting the IDE, using File > Invalidate caches/ restart

  4. Delete the .idea  & .gradle project and rebuild or reimport the project

Can't resolve generated AutoValue classes AutoValue_*:

To fix this issue, you should enable annotation processing in IntelliJ. For that, you will need to go 

File → Settings → Build, Execution, Deployment → Compiler → Annotation Processors

And check "Enable annotation processing" as in the following image.

Image Added

After that, you will need to run the build of that specific module. If for example, you want to work on "ElasticsearchIO", you will need to open gradle sidebar, 

Image Added

beam → Tasks → sdks → io → elasticsearch

Image Added