简体   繁体   中英

NetBeans (maven) project: checkstyle-beans vs maven-checkstyle-plugin

There are at least two ways of using the checkstyle in the NetBean maven project
(at the time of 2019-07-24):

  • using the NetBeans's plugin checkstyle-beans
    v4.1.0, last Update: 2016-02-09, uses Checkstyle v6.15.
    The last declared supported version is NetBeans v8.1
    *although it works with v8.2

  • using the Maven's plugin maven-checkstyle-plugin
    v3.1.0, last Update: 2019-05-12, uses Checkstyle v8.19

The last version of the github.com/checkstyle itself is v8.22

Questions:

  1. Can I update them both to the last checkstyle?
  2. Does they completely independent ?
    • the checkstyle-beans shows the marks beside the line numbers in the IDE
    • the maven-checkstyle-plugin can be used for the manual launch in the console, outside the IDE ( mvn -e checkstyle:check ).
      Can it be configured and used inside the IDE ?

As a Netbeans user, you are stuck with Checkstyle-Beans as far as in-IDE support goes. Maven and Checkstyle-Beans are completely independent of each other, but both depend on Checkstyle, of which they should use the same version.
This means you are also stuck with Checkstyle 6.15 (no upgrade unless Checkstyle-Beans gets a new version), which you must consequently use everywhere else also, or your Checkstyle configuration will not work (for example Checkstyle 6.15 config XMLs won't work with Checkstyle 8.22).

So, you have three options:

  • Use a different IDE, such as IntelliJ or Eclipse. Both have up-to-date Checkstyle support, so you can use the latest Checkstyle both in Maven and in the IDE.
  • Continue with Netbeans, and use Checkstyle 6.15. This is actually feasible imho. Checkstyle docs are versioned these days, so you can see the correct docs at https://checkstyle.sourceforge.io/version/6.15/ . This will get you Checkstyle 6.15 support in Maven and in the IDE.
  • Continue with Netbeans, and use latest Checkstyle. Then you can only run it via Maven, but I suppose you can configure a button in NetBeans to make this easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM