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.
Java 8
File -> project structure -> project
project SDK = JDK 1.8
project language level = 8.0 - Lambda support, type annotations, etc
(https://www.jetbrains.com/idea/help/project-general-settings-page.html)
Lombok support
Lombok plugin
File > Settings > Plugins > Browse repositories... > Search for "lombok" > Install Plugin
Activate annotation processing
File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors > Enable annotation processing
Ruby
Ruby plugin
File > Settings > Plugins > Browse repositories... > Search for "ruby" > Install plugin "Ruby"
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
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