mvn checkstyle:checkstyle uses wrong configuration when using reporting

Jan-Willem Gmelig Meyling

Im facing the following problem. I have set up my checkstyle with the following configuration:

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${checkstyle.plugin.version}</version>
            <inherited/>
            <configuration>
                <configLocation>${basedir}/checkstyle.xml</configLocation>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
            </configuration>
        </plugin>
    </plugins>
</reporting>

This runs fine when I run mvn site. However, when I run checkstyle through mvn checkstyle:checkstyle in order to get the XML report much more efficiently, the checkstyle plugin fails back to use the default configuration. When I move the plugin to <build> the XML is generated properly, but now the checkstyle report is not included in the generated site anymore.

What is the (current) way of setting up report plugins as Checkstyle, while perserving the ability to run the plugin separately under the same configuration?

Is it really the preferred way to defined your plugins and configuration twice?

Jan-Willem Gmelig Meyling

Okay, apparently you should add the plugin with configuration to both <build> and <reporting>.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Got "Could not find resource 'src/checkstyle/checkstyle-suppressions.xml" when using spring boot 1.3.1

From Java

mvn checkstyle plugin: google_checks no reached

From Dev

Maven: Why can I run mvn checkstyle:checkstyle without pom.xml config?

From Dev

Google checkstyle configuration is failing on an Android project

From Dev

Eclipse Checkstyle - unable to parse configuration stream

From Dev

Custom checkstyle configuration ignores standard rules?

From Dev

Property does not exist error in checkstyle configuration file

From Dev

Difference with Checkstyle and PMD configuration in maven parent module

From Dev

How to Configure a Checkstyle Configuration for Java in Jenkins

From Dev

Checkstyle validation fail when needs multiple lines

From Dev

Using "excludes" config in Findbugs and Checkstyle plugin in Gradle

From Dev

How to suppress warnings in maven output when using maven-checkstyle-plugin?

From Dev

Eclipse "Apply Checkstyle fixes" or "Quick Fix" does nothing when trying to fix checkstyle errors in a java file

From Dev

Eclipse "Apply Checkstyle fixes" or "Quick Fix" does nothing when trying to fix checkstyle errors in a java file

From Dev

Maven checkstyle plugin - check goal cannot find configuration file

From Dev

Checkstyle plugin doesn't care what's in external configuration file

From Dev

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

From Dev

NoSuchMethodError when running Checkstyle 5.5 in Play 2.2 project?

From Dev

NoSuchMethodError when running Checkstyle 5.5 in Play 2.2 project?

From Dev

Integrate JSHint into Jenkins without using the Checkstyle or JSLint reporter

From Dev

How to verify used encoding in sourcefiles using checkstyle-plugin?

From Dev

Integrate JSHint into Jenkins without using the Checkstyle or JSLint reporter

From Dev

Using built-in checkstyle configuraiton from command line

From Dev

Gradle Unable to run checkstyle

From Dev

Migrating maven checkstyle to gradle

From Dev

Checkstyle - whitelist of warnings to suppress

From Dev

PMD gets in the way of CheckStyle

From Dev

Java - Checkstyle - Redundant Throws

From Dev

configuring customimport order in checkstyle

Related Related

  1. 1

    Got "Could not find resource 'src/checkstyle/checkstyle-suppressions.xml" when using spring boot 1.3.1

  2. 2

    mvn checkstyle plugin: google_checks no reached

  3. 3

    Maven: Why can I run mvn checkstyle:checkstyle without pom.xml config?

  4. 4

    Google checkstyle configuration is failing on an Android project

  5. 5

    Eclipse Checkstyle - unable to parse configuration stream

  6. 6

    Custom checkstyle configuration ignores standard rules?

  7. 7

    Property does not exist error in checkstyle configuration file

  8. 8

    Difference with Checkstyle and PMD configuration in maven parent module

  9. 9

    How to Configure a Checkstyle Configuration for Java in Jenkins

  10. 10

    Checkstyle validation fail when needs multiple lines

  11. 11

    Using "excludes" config in Findbugs and Checkstyle plugin in Gradle

  12. 12

    How to suppress warnings in maven output when using maven-checkstyle-plugin?

  13. 13

    Eclipse "Apply Checkstyle fixes" or "Quick Fix" does nothing when trying to fix checkstyle errors in a java file

  14. 14

    Eclipse "Apply Checkstyle fixes" or "Quick Fix" does nothing when trying to fix checkstyle errors in a java file

  15. 15

    Maven checkstyle plugin - check goal cannot find configuration file

  16. 16

    Checkstyle plugin doesn't care what's in external configuration file

  17. 17

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

  18. 18

    NoSuchMethodError when running Checkstyle 5.5 in Play 2.2 project?

  19. 19

    NoSuchMethodError when running Checkstyle 5.5 in Play 2.2 project?

  20. 20

    Integrate JSHint into Jenkins without using the Checkstyle or JSLint reporter

  21. 21

    How to verify used encoding in sourcefiles using checkstyle-plugin?

  22. 22

    Integrate JSHint into Jenkins without using the Checkstyle or JSLint reporter

  23. 23

    Using built-in checkstyle configuraiton from command line

  24. 24

    Gradle Unable to run checkstyle

  25. 25

    Migrating maven checkstyle to gradle

  26. 26

    Checkstyle - whitelist of warnings to suppress

  27. 27

    PMD gets in the way of CheckStyle

  28. 28

    Java - Checkstyle - Redundant Throws

  29. 29

    configuring customimport order in checkstyle

HotTag

Archive