8

Highlighting Checkstyle Links using Maven and IntelliJ IDEA

 3 years ago
source link: http://andreas.haufler.info/2015/06/highlighting-checkstyle-links-using.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Monday, June 1, 2015

Highlighting Checkstyle Links using Maven and IntelliJ IDEA

Although IntelliJ IDEA has en excellent Maven integration, it doesn not recognize file references or file links in the output of Maven commands. One such generator of file links is checkstyle which generates an output like this:
Bildschirmfoto%2B2015-06-01%2Bum%2B22.04.53.png
 Now our live would be a lot easier, if we could just click on the message to fix the issue. Luckily, with a litte hack, this is possible: IntelliJ provides a possibility to define custom output filters for "External Tools". Therefore navigate to "Preferences > Tools > External Tools". Add a new one with "mvn" as command and "validate" or whatever triggers checkstyle as parameter.
Bildschirmfoto%2B2015-06-01%2Bum%2B22.04.05.png
Then click on "Output Filters" and a a Filter with an arbitrary name and "$FILE_PATH$:$LINE$(:$COLUMN$)?.*" as Regular Expression.
If you now choose "Tools -> External Tools -> Checkstyle" Maven will run again producing a nicely linked output:
Bildschirmfoto%2B2015-06-01%2Bum%2B22.05.59.png

No comments:

Post a Comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK