11938

Eclipse CheckStyle

Question:

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

Answer1:

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.

Answer2:

You have to fix your checkstyle warnings manually.

Recommend

  • Eclipse Checkstyle vs Formatter vs Cleanup?
  • What is difference between public static and static public? [duplicate]
  • Checkstyle - How to exclude any file, but the ones ending with 'Impl.java', with a regex?
  • Writing a Build Script for a Play! Framework application
  • How to execute javascript method from server side?
  • Django : Model Instance history
  • JENKINS: ERROR when I try to use an older JDK for a specific maven project
  • Regarding client side code generation from WSDL
  • Base64 as method of sanitizing user input for Mysql
  • What version of Java should I use with Cassandra 2.0?
  • Plotting Route with Multiple Points in iOS
  • Python: Split a String Field into 3 Separate Fields using Lambda
  • maven jboss-as:start A required class was missing … org/sonaty…/ArtifactResolutionException
  • Cordova Apache wrong module path
  • How do you keep a running instance for Google App Engine
  • ASPNetCore MVC Routing Let Server Handle Specific Route
  • to implement a spinner in angular2+
  • Mocha throws unexpected token error for ES6 object spread operator
  • How do you create a Fuseki SPARQL server using the Apache Jena Java API?
  • Scala: Function returning an unknown type
  • jQuery - resize an elements height to match window without refreshing, on window resize
  • Primefaces lazy datascroller calling load twice
  • How to access meteor package name inside package?
  • Rest Services conventions
  • Prevent Tomcat from caching request during starup
  • Casting between Interfaces and Classes
  • SonarQube: Cannot deactivate rule with missing quality profile
  • Reduction and collapse clauses in OMP have some confusing points
  • MongoDb aggregation
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Fetching methods from BroadcastReceiver to update UI
  • Validaiting emails with Net.Mail MailAddress
  • Which linear programming package should I use for high numbers of constraints and “warm starts” [clo
  • Javascript + PHP Encryption with pidCrypt
  • WPF Applying a trigger on binding failure
  • Benchmarking RAM performance - UWP and C#
  • Acquiring multiple attributes from .xml file in c#
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal