Skip to content

Commit

Permalink
Improve the use of checkstyle in the build (apache#477)
Browse files Browse the repository at this point in the history
* Improve the use of checkstyle in the build
* Fix wording
  • Loading branch information
gnodet authored Jul 6, 2021
1 parent a7010c5 commit 46410d3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
1 change: 1 addition & 0 deletions .mvn/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
The .mvn directory is needed to be able to use the ${maven.multiModuleProjectDirectory} property.
30 changes: 30 additions & 0 deletions build/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 0 additions & 4 deletions maven-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
25 changes: 23 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down

0 comments on commit 46410d3

Please sign in to comment.