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

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new 46410d3  Improve the use of checkstyle in the build (#477)
46410d3 is described below

commit 46410d3df2458af9b2118ace6cc1a68b75c5d262
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue Jul 6 08:09:20 2021 +0200

    Improve the use of checkstyle in the build (#477)
    
    * Improve the use of checkstyle in the build
    * Fix wording
---
 .mvn/readme.txt                   |  1 +
 build/checkstyle-suppressions.xml | 30 ++++++++++++++++++++++++++++++
 maven-model/pom.xml               |  4 ----
 pom.xml                           | 25 +++++++++++++++++++++++--
 4 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/.mvn/readme.txt b/.mvn/readme.txt
new file mode 100644
index 0000000..c2d3655
--- /dev/null
+++ b/.mvn/readme.txt
@@ -0,0 +1 @@
+The .mvn directory is needed to be able to use the 
${maven.multiModuleProjectDirectory} property.
\ No newline at end of file
diff --git a/build/checkstyle-suppressions.xml 
b/build/checkstyle-suppressions.xml
new file mode 100644
index 0000000..78e9e3c
--- /dev/null
+++ b/build/checkstyle-suppressions.xml
@@ -0,0 +1,30 @@
+<?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="JavadocVariable|JavadocMethod" files=".*" />
+    <suppress checks="HiddenField" files=".*" />
+    <suppress checks="FileLength" files="ModelMerger\.java" />
+</suppressions>
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index abb6add..83f4bf5 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -33,10 +33,6 @@ under the License.
   <name>Maven Model</name>
   <description>Model for Maven POM (Project Object Model)</description>
 
-  <properties>
-    <checkstyle.violation.ignore>FileLength</checkstyle.violation.ignore>
-  </properties>
-
   <dependencies>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
diff --git a/pom.xml b/pom.xml
index ea82503..47586fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,8 +76,6 @@ under the License.
     <distributionShortName>Maven</distributionShortName>
     <distributionName>Apache Maven</distributionName>
     <maven.site.path>ref/4-LATEST</maven.site.path>
-    <checkstyle.violation.ignore>None</checkstyle.violation.ignore>
-    <checkstyle.excludes>**/package-info.java</checkstyle.excludes>
     
<project.build.outputTimestamp>2021-04-05T08:12:18Z</project.build.outputTimestamp>
   </properties>
 
@@ -591,6 +589,8 @@ under the License.
               <!--
                 ! Excluded the license files itself cause they do not have 
have a license of themselves.
               -->
+              
<exclude>src/main/appended-resources/licenses/MIT-slf4j-api-1.7.30.txt</exclude>
+              
<exclude>src/main/appended-resources/licenses/MIT-jsoup-1.12.1.txt</exclude>
               
<exclude>src/main/appended-resources/licenses/CDDL-1.0.txt</exclude>
               
<exclude>src/main/appended-resources/licenses/EPL-1.0.txt</exclude>
               
<exclude>src/main/appended-resources/licenses/unrecognized-javax.annotation-api-1.3.2.txt</exclude>
@@ -673,6 +673,27 @@ under the License.
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>3.1.2</version>
+        <configuration>
+          <violationSeverity>info</violationSeverity>
+          
<suppressionsLocation>${maven.multiModuleProjectDirectory}/build/checkstyle-suppressions.xml</suppressionsLocation>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>8.41.1</version>
+          </dependency>
+          <dependency>
+            <groupId>org.apache.maven.shared</groupId>
+            <artifactId>maven-shared-resources</artifactId>
+            <version>3</version>
+          </dependency>
+        </dependencies>
+      </plugin>
     </plugins>
   </build>
 

Reply via email to