VOOZH about

URL: https://www.javacodegeeks.com/2015/06/highlighting-checkstyle-links-using-maven-and-intellij-idea.html

⇱ Highlighting Checkstyle Links using Maven and IntelliJ IDEA - Java Code Geeks


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 2015-06-01 um 22.04.53

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 2015-06-01 um 22.04.05

Then click on β€œOutput Filters” and a a Filter with an arbitrary name and β€œ$FILE_PATH$:$LINE$(:$COLUMN$)?.*” as Regular Expression.

πŸ‘ Bildschirmfoto 2015-06-01 um 22.05.31

If you now choose β€œTools -> External Tools -> Checkstyle” Maven will run again producing a nicely linked output:

πŸ‘ Bildschirmfoto 2015-06-01 um 22.05.59

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

πŸ‘ Photo of Andreas Haufler
Andreas Haufler
June 4th, 2015Last Updated: June 3rd, 2015
1 324 1 minute read
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
Geff Chang
11 years ago

Does Eclipse also have this feature?

0
Reply
Back to top button
Close
wpDiscuz