This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 8cd79abd662663a1bef090f8c79c587273fceb84
Author: aherbert <[email protected]>
AuthorDate: Mon May 20 12:47:05 2019 +0100

    Consolidate checkstyle config for build.
    
    Enable fail on violation and checks for test sources.
    
    Add checkstyle suppressions file to exclude tests.
---
 pom.xml                                            | 25 ++++++----------------
 .../checkstyle/checkstyle-suppressions.xml         | 24 +++++++++++++++++++++
 2 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/pom.xml b/pom.xml
index 842ea30..3749647 100644
--- a/pom.xml
+++ b/pom.xml
@@ -228,11 +228,16 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>${statistics.checkstyle.version}</version>
         <configuration>
           
<configLocation>${statistics.parent.dir}/src/main/resources/checkstyle/checkstyle.xml</configLocation>
           
<headerLocation>${statistics.parent.dir}/src/main/resources/checkstyle/license-header.txt</headerLocation>
+          
<suppressionsLocation>${statistics.parent.dir}/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
           <enableRulesSummary>false</enableRulesSummary>
-          <includeResources>false</includeResources>
+          <includeTestSourceDirectory>true</includeTestSourceDirectory>
+          <logViolationsToConsole>false</logViolationsToConsole>
+          <failOnViolation>true</failOnViolation>
+          
<resourceExcludes>NOTICE.txt,LICENSE.txt,**/maven-archiver/pom.properties</resourceExcludes>
         </configuration>
         <executions>
           <execution>
@@ -295,24 +300,6 @@
         </configuration>
       </plugin>
     </plugins>
-
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-checkstyle-plugin</artifactId>
-          <version>${statistics.checkstyle.version}</version>
-          <configuration>
-            <includeTestSourceDirectory>false</includeTestSourceDirectory>
-            
<configLocation>${statistics.parent.dir}/src/main/resources/checkstyle/checkstyle.xml</configLocation>
-            
<headerLocation>${statistics.parent.dir}/src/main/resources/checkstyle/license-header.txt</headerLocation>
-            <logViolationsToConsole>false</logViolationsToConsole>
-            <failOnViolation>false</failOnViolation>
-            <resourceExcludes>NOTICE.txt,LICENSE.txt</resourceExcludes>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
   </build>
 
   <reporting>
diff --git a/src/main/resources/checkstyle/checkstyle-suppressions.xml 
b/src/main/resources/checkstyle/checkstyle-suppressions.xml
new file mode 100644
index 0000000..6ccaa63
--- /dev/null
+++ b/src/main/resources/checkstyle/checkstyle-suppressions.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<!DOCTYPE suppressions PUBLIC
+    "-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
+    "https://checkstyle.org/dtds/suppressions_1_0.dtd";>
+<suppressions>
+  <suppress checks="Javadoc" files=".*[/\\]test[/\\].*" />
+  <suppress checks="MultipleStringLiterals" files=".*[/\\]test[/\\].*" />
+</suppressions>

Reply via email to