storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yang xiao <shawnxiao...@gmail.com>
Subject How to checkstyle based on storm_checkstyle xml
Date Fri, 13 Oct 2017 07:49:01 GMT
Hi,


I refer to https://issues.apache.org/jira/browse/STORM-2565 and want to use
checkstyle to get familiar with building Storm.

>From Source Code, I understand that *storm-checkstyle *is custom developed
checkstyle project which is included in all projects as a dependency to the
Checkstyle Plugin. And validate phase will check style and generate
checkstyle-violation.xml in target folder.

 <plugin>
                    <!--To support checkstyle goals. For example: "mvn
checkstyle:checkstyle"-->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.17</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.storm</groupId>
                            <artifactId>storm-checkstyle</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <!-- If you change this, you should also update
the storm_checkstyle.xml file to be
                            based on the google_checks.xml from the version
of checkstyle you are choosing. -->
                            <version>8.2</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <configuration>

<configLocation>storm/storm_checkstyle.xml</configLocation>
                                <encoding>UTF-8</encoding>
                                <failOnViolation>true</failOnViolation>

<logViolationsToConsole>false</logViolationsToConsole>

<outputFile>target/checkstyle-violation.xml</outputFile>

<violationSeverity>warning</violationSeverity>
                            </configuration>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

When I execute* mvn validate*, it will use storm_checkstyle.xml to check
the code style and generate corresponding checkstyle-violation.xml in target
 folder.

For examle, storm-rocketmq has no violation based on
https://issues.apache.org/jira/browse/STORM-2594

But when I execute mvn checkstyle:checkstyle, it will use sun-checks.xml.



>\storm\external\storm-rocketmq>mvn checkstyle:checkstyle

[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building storm-rocketmq 2.0.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[WARNING] The POM for org.apache.logging.log4j:log4j-api:jar:2.8.2 is
invalid, transitive dependencies (if any) will not be available, enable
debug logging for more details
[WARNING] The POM for org.apache.logging.log4j:log4j-core:jar:2.8.2 is
invalid, transitive dependencies (if any) will not be available, enable
debug logging for more details
[WARNING] The POM for org.apache.logging.log4j:log4j-slf4j-impl:jar:2.8.2
is invalid, transitive dependencies (if any) will not be available, enable
debug logging for more details
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default-cli) @
storm-rocketmq ---
[INFO] *There are 383 errors reported by Checkstyle 8.2 with sun_checks.xml
ruleset.*
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 5.992 s
[INFO] Finished at: 2017-10-13T15:44:47+08:00
[INFO] Final Memory: 29M/292M
[INFO]
------------------------------------------------------------------------

How could I use checkstyle:checkstyle or checkstyle:check command based on
storm_checkstyle.xml?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message