How to Configure X-Road Project in IntelliJ Idea?

How to Configure X-Road Project in IntelliJ Idea?

How to configure X-Road project in IntelliJ Idea?

Step-by-step guide

The following steps are required to configure X-Road project in IntelliJ Idea.

There may be minor differences in the location of different configuration items between different versions of IntelliJ Idea.

 

  1. Java 8

  2. Lombok support

    • Lombok plugin 

    • Activate annotation processing

      • File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors > Enable annotation processing

  3. Ruby

    • Ruby plugin 

      • File > Settings > Plugins > Browse repositories... > Search for "ruby" > Install plugin "Ruby"

  4. Checkstyle

    • Checkstyle plugin

      • File > Settings > Plugins > Browse repositories... > Search for "checkstyle" > Install plugin "CheckStyle-IDEA"

      • File > Settings > Other Settings > Checkstyle > Configuration File > Add > Use a local Checkstyle file

        • Description "X-Road checkstyle configuration"

        • Browse > X-Road/src/config/checkstyle/checkstyle.xml

        • Next > config_loc -> insert here absolute path to the directory containing checkstyle.xml

          • Path must be inserted without the filename and trailing slash, e.g. "/path/to/dir"

        • Activate "X-Road checkstyle configuration"

        • Scan scope: Only Java sources (including tests)

        • Checkstyle version in build.gradle is currently 8.29, it is recommended to use the same version of Idea plugin

      • Usage by selecting View > Tool Windows > Checkstyle

        • Activate correct set of rules from the dropdown menu

        • Click "Check Project" button to scan the whole project

  5. Code formatting

    • See the page X-Road Java code style. The Checkstyle rules can be imported to IDEA:

    • File->Settings->Editor->Code Style->Java: Scheme: Project, Import Scheme->Checkstyle. Choose X-Road/src/config/checkstyle/checkstyle.xml 

    • JavaDoc: remove "Generate <p> on empty lines"

Related articles