0

Recently I added a new checkstyle (XML) file in Eclipse.

After I ran mvn checkstyle:checkstyle, I saw a bunch of checkstyle errors in A.java.

Then, in Eclipse, I right-clicked A.java, and picked "Apply Checkstyle Fixes." However, no changes were made.

Please advise me on how to apply my checkstyle changes.

Note: I do not have Eclipse configured to build. I only use it for changing code, and then I build using maven on the command-line.

Thanks

Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384

2 Answers2

1

I don't know what Eclipse plugin you use, but I use eclipse-cs.

In eclipse-cs, when you write a CheckStyle Checker (a class for detecting CheckStyle-related issues), you can write another class as so-called quickfix. If the writer of a Checker does not provide a quickfix, none will be available to you.

As for the maven issue, where your maven output and Eclipse warnings differ: The configuration of Eclipse may differ from the configuration read by maven. Please make sure both use the same configuration file.

RobertG
  • 1,550
  • 1
  • 23
  • 42
0

You have to fix your checkstyle warnings manually.

Kai
  • 38,985
  • 14
  • 88
  • 103
  • I actually right-clicked the file, and then clicked "Check Checkstyle changes." However, only a single checkstyle error shows up in Eclipse. But, running 'mvn checkstyle:checkstyle' shows ~30 checkstyle errors. – Kevin Meredith Oct 10 '12 at 15:20