checkstyle

Is there a way for a Maven project to inherit report configurations from a pom dependency?

只谈情不闲聊 提交于 2019-12-01 18:42:57
I know that it's possible to configure the section in a parent POM and have it apply to the sub-modules in a multi-module project. However, I'd like to have a separate POM to reference as a dependency so I can have a reporting configuration I can "mix in" to various projects without having to replicate my reporting configuration across multiple projects. (See "dependency POMs" here: http://sonatype.com/books/maven-book/reference/pom-relationships-sect-pom-best-practice.html ) For example, for my Widget project, I have a parent POM (widget-parent) with two sub-modules, widget-core and widget

Maven Checkstyle:Check not working

天大地大妈咪最大 提交于 2019-12-01 17:39:35
问题 I have been working on trying to get Checkstyle working in Maven in the Eclipse Indigo IDE for a while. Finally, I thought I will ask for some expert advise on this. I am using Eclipse Indigo and trying to configure Checkstyle to run in Maven. Below is a snippet of my pom.xml. Only checkstyle:checkstyle is working and creating the reports. <profile> <id>checkstyle-profile</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin<

CheckStyle checks not been ignored

假装没事ソ 提交于 2019-12-01 17:02:27
I have set up my checkstyle checks in my pom.xml as follows <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.10</version> <configuration> <suppressionsLocation> checkstyle-suppressions.xml </suppressionsLocation> <suppressionsFileExpression> checkstyle-suppressions.xml </suppressionsFileExpression> </configuration> </plugin> </plugins> </reporting> my checkstyle-supressions.xml file contains the following <?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http:/

Error using checkstyle/google_checks.xml with maven-checkstyle-plugin

二次信任 提交于 2019-12-01 16:37:25
I am trying to use checkstyles google_checks.xml with maven-checkstyle-plugin . If I use the google_checks.xml with the latest checkstyle intelliJ plugin everything is correct but when I try configurating it via maven-checkstyle plugin I get this error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.13:check (default-cli) on project XX_XX_XX: Failed during checkstyle configuration: cannot initialize module TreeWalker - Unable to instantiate AvoidEscapedUnicodeCharacters: Unable to instantiate AvoidEscapedUnicodeCharactersCheck My pom.xml looks like this:

Error using checkstyle/google_checks.xml with maven-checkstyle-plugin

自古美人都是妖i 提交于 2019-12-01 15:17:52
问题 I am trying to use checkstyles google_checks.xml with maven-checkstyle-plugin. If I use the google_checks.xml with the latest checkstyle intelliJ plugin everything is correct but when I try configurating it via maven-checkstyle plugin I get this error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.13:check (default-cli) on project XX_XX_XX: Failed during checkstyle configuration: cannot initialize module TreeWalker - Unable to instantiate

“First sentence should end with a period.”

三世轮回 提交于 2019-12-01 15:13:07
Java checkstyle confuses and baffles me. package pmain; /** * Some text here. */ public class Main { } This is literally all of the code I have. Checkstyle displays a "First sentence should end with a period." at the "/**". Why does CheckStyle produce this warning? Could the checkstyle config I'm required to use be broken? Am I doing something wrong? Is "Some text here" not the first sentence? Is "." not a period? Jimmy Zhang The first sentence should end with a dot. /** *An abstract class that represents an algorithm. * * @author zhangtj * * @version 1.0 */ Would pass. Just tested on my

Checkstyle: Custom Rules - Eclipse Plugin

ε祈祈猫儿з 提交于 2019-12-01 08:47:35
I have written few custom checkstyle rules using checkstyle API. They run fine using Maven (after I add the new project as a dependency to the checkstyle plugin). Now I want these rules to be used by the Eclipse Checkstyle plugin. And this is where I am stuggling. I've downloaded the sample plugin project (as suggested here and here ). I do not understand what to do next after reading these links. Do I need to export my project as a JAR? How do I plug it into my existing Checkstyle plugin? Thanks You already have the correct links that will eventually get you there. As for your questions: All

Share specific PMD rulesets across multi module maven project

巧了我就是萌 提交于 2019-12-01 06:40:44
I'm trying to share the same pmd configuration across all my submodules. I'm looking for the best way to achieve that I thought that I could place it in the parent project, like I did it for checkstyle plugin Parent pom.xml <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.9.1</version> <configuration> <configLocation>/src/main/config/checkstyle.xml</configLocation> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.7.1</version>

maven eclipse checkstyle plugin

我与影子孤独终老i 提交于 2019-12-01 05:53:13
I have custom checkstyle checks file (called checks.xml), and I'm trying to use that same file in both maven and eclipse. It all works well, except for the SuppressionFilter . In this checks.xml file, I have <module name="SuppressionFilter"> <property name="file" value="src/main/resources/checkstyle/checkstyle-suppressions.xml"/> </module> This works when I run through maven. However, when I run through eclipse, I need to change the config to be <module name="SuppressionFilter"> <property name="file" value="${basedir}/src/main/resources/checkstyle/checkstyle-suppressions.xml"/> </module> If I

Checkstyle: Custom Rules - Eclipse Plugin

无人久伴 提交于 2019-12-01 05:35:57
问题 I have written few custom checkstyle rules using checkstyle API. They run fine using Maven (after I add the new project as a dependency to the checkstyle plugin). Now I want these rules to be used by the Eclipse Checkstyle plugin. And this is where I am stuggling. I've downloaded the sample plugin project (as suggested here and here). I do not understand what to do next after reading these links. Do I need to export my project as a JAR? How do I plug it into my existing Checkstyle plugin?