Make checkstyle plugin work with checkstyle 6.2 git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/branches/MCHECKSTYLE-272@1652339 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml index 6e82645..c14026d 100644 --- a/pom.xml +++ b/pom.xml
@@ -30,7 +30,7 @@ </parent> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.16-SNAPSHOT</version> <packaging>maven-plugin</packaging> <name>Apache Maven Checkstyle Plugin</name> @@ -58,8 +58,10 @@ </distributionManagement> <properties> + <maven.compiler.source>1.7</maven.compiler.source> + <maven.compiler.target>1.7</maven.compiler.target> <mavenVersion>2.2.1</mavenVersion> - <checkstyleVersion>5.9</checkstyleVersion> + <checkstyleVersion>6.2</checkstyleVersion> <doxiaVersion>1.4</doxiaVersion> <sitePluginVersion>3.4</sitePluginVersion> </properties> @@ -303,8 +305,6 @@ <plugins> <plugin> <artifactId>maven-invoker-plugin</artifactId> - <!-- Cannot remove this version yet. maven-plugins:24 uses 1.7, which breaks the ITs --> - <version>1.8</version> <configuration> <goals> <goal>clean</goal> @@ -333,7 +333,7 @@ <artifactId>maven-plugin-plugin</artifactId> <configuration> <requirements> - <jdk>1.5</jdk> + <jdk>${maven.compiler.source}</jdk> </requirements> </configuration> </plugin>
diff --git a/src/it/MCHECKSTYLE-129/pom.xml b/src/it/MCHECKSTYLE-129/pom.xml index cda4a2e..7a68626 100644 --- a/src/it/MCHECKSTYLE-129/pom.xml +++ b/src/it/MCHECKSTYLE-129/pom.xml
@@ -57,7 +57,7 @@ <artifactId>maven-checkstyle-plugin</artifactId> <version>${checkstyleVersion}</version> <configuration> - <configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml</configLocation> + <configLocation>http://svn.apache.org/repos/asf/maven/plugins/branches/MCHECKSTYLE-272/src/main/resources/config/sun_checks.xml</configLocation> </configuration> </plugin> </plugins>
diff --git a/src/it/MCHECKSTYLE-137/checkstyle.xml b/src/it/MCHECKSTYLE-137/checkstyle.xml index 8cba837..4979f11 100644 --- a/src/it/MCHECKSTYLE-137/checkstyle.xml +++ b/src/it/MCHECKSTYLE-137/checkstyle.xml
@@ -110,7 +110,6 @@ <property name="illegalClassNames" value="java.lang.Error,java.lang.RuntimeException"/> </module> <module name="PackageDeclaration"/> - <module name="JUnitTestCase"/> <module name="DeclarationOrder"/> <module name="ExplicitInitialization"/> <module name="DefaultComesLast"/>
diff --git a/src/it/MCHECKSTYLE-163/invoker.properties b/src/it/MCHECKSTYLE-163/invoker.properties deleted file mode 100644 index 88f0d8f..0000000 --- a/src/it/MCHECKSTYLE-163/invoker.properties +++ /dev/null
@@ -1,18 +0,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. - -invoker.goals=verify
diff --git a/src/it/MCHECKSTYLE-163/pom.xml b/src/it/MCHECKSTYLE-163/pom.xml deleted file mode 100644 index b3afd8a..0000000 --- a/src/it/MCHECKSTYLE-163/pom.xml +++ /dev/null
@@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ 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. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>sample</groupId> - <artifactId>sample</artifactId> - <packaging>pom</packaging> - <version>1.0-SNAPSHOT</version> - <name>Example project</name> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.8.1</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>@pom.version@</version> - <configuration> - <includes>**/*.*</includes> - <configLocation>sample.checkstyle</configLocation> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <consoleOutput>true</consoleOutput> - <logViolationsToConsole>true</logViolationsToConsole> - <failOnViolation>true</failOnViolation> - <failsOnError>true</failsOnError> - <violationSeverity>info</violationSeverity> - <maxAllowedViolations>4</maxAllowedViolations> - </configuration> - <executions> - <execution> - <id>checkstyle-verify</id> - <phase>verify</phase> - <goals> - <goal>checkstyle</goal> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file
diff --git a/src/it/MCHECKSTYLE-163/sample.checkstyle b/src/it/MCHECKSTYLE-163/sample.checkstyle deleted file mode 100644 index 6610ee0..0000000 --- a/src/it/MCHECKSTYLE-163/sample.checkstyle +++ /dev/null
@@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ 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 module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> -<module name="Checker"> - <property name="severity" value="warning"/> - <module name="TreeWalker"> - <property name="cacheFile" value="target/cachefile"/> - <module name="RedundantThrows"/> - </module> -</module>
diff --git a/src/it/MCHECKSTYLE-163/src/test/java/sample/Example.java b/src/it/MCHECKSTYLE-163/src/test/java/sample/Example.java deleted file mode 100644 index 692f721..0000000 --- a/src/it/MCHECKSTYLE-163/src/test/java/sample/Example.java +++ /dev/null
@@ -1,33 +0,0 @@ -package sample; - -/* - * 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. - */ - -import org.junit.runners.model.InitializationError; - -public class Example { - - public void shouldTriggerRedundantThrows() throws InitializationError, Exception {} - - public void shouldNotTriggerRedundantThrows() throws InitializationError {} - - public void workingRedundantThrowsExample() throws IllegalArgumentException, Exception {} - - public void workingDoesNotTriggerRedundantThrowsExample() throws IllegalArgumentException {} -} \ No newline at end of file
diff --git a/src/it/MCHECKSTYLE-193/checkstyle.xml b/src/it/MCHECKSTYLE-193/checkstyle.xml index 07bd2bd..7e0c3e2 100644 --- a/src/it/MCHECKSTYLE-193/checkstyle.xml +++ b/src/it/MCHECKSTYLE-193/checkstyle.xml
@@ -113,7 +113,6 @@ <property name="illegalClassNames" value="java.lang.Error,java.lang.RuntimeException"/> </module> <module name="PackageDeclaration"/> - <module name="JUnitTestCase"/> <module name="DeclarationOrder"/> <module name="ExplicitInitialization"/> <module name="DefaultComesLast"/>
diff --git a/src/it/multi-modules/pom.xml b/src/it/multi-modules/pom.xml index 5f57b1b..7b13794 100644 --- a/src/it/multi-modules/pom.xml +++ b/src/it/multi-modules/pom.xml
@@ -39,8 +39,8 @@ <artifactId>maven-checkstyle-plugin</artifactId> <version>@pom.version@</version> <configuration> - <configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml</configLocation> - <headerLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt</headerLocation> + <configLocation>http://svn.apache.org/repos/asf/maven/plugins/branches/MCHECKSTYLE-272/src/main/resources/config/maven_checks.xml</configLocation> + <headerLocation>http://svn.apache.org/repos/asf/maven/plugins/branches/MCHECKSTYLE-272/src/main/resources/config/maven-header.txt</headerLocation> </configuration> </plugin> </plugins> @@ -75,4 +75,4 @@ <module>multi-modules-child</module> <module>multi-modules-child-nosource</module> </modules> -</project> \ No newline at end of file +</project>
diff --git a/src/main/resources/config/maven_checks.xml b/src/main/resources/config/maven_checks.xml index ca82ceb..2d7bd55 100644 --- a/src/main/resources/config/maven_checks.xml +++ b/src/main/resources/config/maven_checks.xml
@@ -176,7 +176,6 @@ <property name="ignoreNumbers" value="-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 31, 32, 37, 64, 100, 128, 256, 512, 1000, 1024"/> </module> <module name="MissingSwitchDefault"/> - <module name="RedundantThrows"/> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/>
diff --git a/src/main/resources/config/sun_checks.xml b/src/main/resources/config/sun_checks.xml index 49652e2..c4be37a 100644 --- a/src/main/resources/config/sun_checks.xml +++ b/src/main/resources/config/sun_checks.xml
@@ -165,7 +165,6 @@ <module name="InnerAssignment"/> <module name="MagicNumber"/> <module name="MissingSwitchDefault"/> - <module name="RedundantThrows"/> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/>
diff --git a/src/main/resources/config/turbine_checks.xml b/src/main/resources/config/turbine_checks.xml index ebd8fb7..bcd9860 100644 --- a/src/main/resources/config/turbine_checks.xml +++ b/src/main/resources/config/turbine_checks.xml
@@ -178,7 +178,6 @@ <module name="InnerAssignment"/> <module name="MagicNumber"/> <module name="MissingSwitchDefault"/> - <module name="RedundantThrows"/> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/>