Author: gboue Date: Fri Jan 27 21:29:10 2017 New Revision: 1780613 URL: http://svn.apache.org/viewvc?rev=1780613&view=rev Log: [MCHECKSTYLE-275] remove old deprecated parameters from report
Now that we're moving to the next major 3.0.0, the old deprecated parameters from CheckstyleReport can be removed. The parameter packageNamesLocation, although not officially deprecated, doesn't do anything since the upgrade to Checkstyle 5.0 (circa 2009 in version 2.4 with r825243 in CHECKSTYLE-105) which removed that support, and can safely be removed as well. Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/custom-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/dep-resolution-exception-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/fail-on-error-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/min-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-files-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-rules-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-severity-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-source-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/test-source-directory-plugin-config.xml maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/useFile-plugin-config.xml Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java Fri Jan 27 21:29:10 2017 @@ -20,21 +20,15 @@ package org.apache.maven.plugins.checkst */ import java.io.File; -import java.net.URL; -import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Locale; -import java.util.Map; import org.apache.maven.model.Resource; import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.MavenReportException; -import org.codehaus.plexus.util.StringUtils; /** * A reporting task that performs Checkstyle analysis and generates an HTML @@ -49,96 +43,6 @@ import org.codehaus.plexus.util.StringUt public class CheckstyleReport extends AbstractCheckstyleReport { - /** - * @deprecated Remove with format parameter. - */ - private static final Map<String, String> FORMAT_TO_CONFIG_LOCATION; - - static - { - Map<String, String> fmt2Cfg = new HashMap<>(); - - fmt2Cfg.put( "sun", "sun_checks.xml" ); - - FORMAT_TO_CONFIG_LOCATION = Collections.unmodifiableMap( fmt2Cfg ); - } - - /** - * Specifies what predefined check set to use. Available sets are "sun" (for - * the Sun coding conventions), and "maven". - * - * @deprecated Use configLocation instead. - */ - @Parameter( defaultValue = "sun" ) - private String format; - - /** - * Specifies the location of the Checkstyle properties file that will be used to - * check the source. - * - * @deprecated Use propertiesLocation instead. - */ - @Parameter - private File propertiesFile; - - /** - * Specifies the URL of the Checkstyle properties that will be used to check - * the source. - * - * @deprecated Use propertiesLocation instead. - */ - @Parameter - private URL propertiesURL; - - /** - * Specifies the location of the License file (a.k.a. the header file) that - * is used by Checkstyle to verify that source code has the correct - * license header. - * - * @deprecated Use headerLocation instead. - */ - @Parameter( defaultValue = "${basedir}/LICENSE.txt" ) - private File headerFile; - - /** - * Specifies the location of the suppressions XML file to use. The plugin - * defines a Checkstyle property named - * <code>checkstyle.suppressions.file</code> with the value of this - * property. This allows using the Checkstyle property in your own custom - * Checkstyle configuration file when specifying a suppressions file. - * - * @deprecated Use suppressionsLocation instead. - */ - @Parameter - private String suppressionsFile; - - /** - * <p> - * Specifies the location of the package names XML to be used to configure - * the Checkstyle <a - * href="http://checkstyle.sourceforge.net/config.html#Packages">Packages</a>. - * </p> - * <p/> - * <p> - * This parameter is resolved as resource, URL, then file. If resolved to a - * resource, or a URL, the contents of the package names XML is copied into - * the <code>${project.build.directory}/checkstyle-packagenames.xml</code> - * file before being passed to Checkstyle for loading. - * </p> - * - * @since 2.0-beta-2 - */ - @Parameter - private String packageNamesLocation; - - /** - * Specifies the location of the package names XML to be used to configure - * Checkstyle. - * - * @deprecated Use packageNamesLocation instead. - */ - @Parameter - private String packageNamesFile; /** {@inheritDoc} */ protected MavenProject getProject() @@ -150,7 +54,6 @@ public class CheckstyleReport public void executeReport( Locale locale ) throws MavenReportException { - mergeDeprecatedInfo(); super.executeReport( locale ); } @@ -234,72 +137,4 @@ public class CheckstyleReport return false; } - /** - * Merge in the deprecated parameters to the new ones, unless the new - * parameters have values. - * @throws MavenReportException - * - * @deprecated Remove when deprecated params are removed. - */ - private void mergeDeprecatedInfo() - throws MavenReportException - { - if ( "sun_checks.xml".equals( configLocation ) && !"sun".equals( format ) ) - { - configLocation = FORMAT_TO_CONFIG_LOCATION.get( format ); - - throw new MavenReportException( "'format' parameter is deprecated: please replace with <configLocation>" - + configLocation + "</configLocation>." ); - } - - if ( StringUtils.isEmpty( propertiesLocation ) ) - { - if ( propertiesFile != null ) - { - propertiesLocation = propertiesFile.getPath(); - - throw new MavenReportException( "'propertiesFile' parameter is deprecated: please replace with " - + "<propertiesLocation>" + propertiesLocation + "</propertiesLocation>." ); - } - else if ( propertiesURL != null ) - { - propertiesLocation = propertiesURL.toExternalForm(); - - throw new MavenReportException( "'propertiesURL' parameter is deprecated: please replace with " - + "<propertiesLocation>" + propertiesLocation + "</propertiesLocation>." ); - } - } - - if ( "LICENSE.txt".equals( headerLocation ) ) - { - File defaultHeaderFile = new File( project.getBasedir(), "LICENSE.txt" ); - if ( !defaultHeaderFile.equals( headerFile ) ) - { - headerLocation = headerFile.getPath(); - } - } - - if ( StringUtils.isEmpty( suppressionsLocation ) ) - { - suppressionsLocation = suppressionsFile; - - if ( StringUtils.isNotEmpty( suppressionsFile ) ) - { - throw new MavenReportException( "'suppressionsFile' parameter is deprecated: please replace with " - + "<suppressionsLocation>" + suppressionsLocation + "</suppressionsLocation>." ); - } - } - - if ( StringUtils.isEmpty( packageNamesLocation ) ) - { - packageNamesLocation = packageNamesFile; - - if ( StringUtils.isNotEmpty( packageNamesFile ) ) - { - throw new MavenReportException( "'packageNamesFile' parameter is deprecated: please replace with " - + "<packageNamesFile>" + suppressionsLocation + "</packageNamesFile>." ); - } - } - } - } Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm Fri Jan 27 21:29:10 2017 @@ -253,7 +253,6 @@ mycompany-checkstyle-checks-1.0.jar <version>${project.version}</version> <configuration> <configLocation>checkstyle.xml</configLocation> - <packageNamesLocation>com/mycompany/checks/packagenames.xml</packageNamesLocation> </configuration> </plugin> </plugins> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/custom-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/custom-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/custom-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/custom-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -31,7 +31,6 @@ under the License. <includes>**/*.java</includes> <configLocation>google_checks.xml</configLocation> <headerLocation>LICENSE.txt</headerLocation> - <headerFile>${basedir}/src/test/test-sources/LICENSE.txt</headerFile> <cacheFile>${basedir}/target/test-harness/checkstyle/custom/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/custom/checkstyle-result.xml</outputFile> <outputFileFormat>plain</outputFileFormat> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/dep-resolution-exception-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/dep-resolution-exception-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/dep-resolution-exception-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/dep-resolution-exception-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/dep-resolution/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/dep-resolution/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/fail-on-error-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/fail-on-error-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/fail-on-error-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/fail-on-error-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/fail-on-error/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/fail-on-error/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/min-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/min-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/min-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/min-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/min/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/min/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-files-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-files-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-files-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-files-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/no-files/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/no-files/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-rules-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-rules-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-rules-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-rules-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/no-rules/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/no-rules/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-severity-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-severity-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-severity-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-severity-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/no-severity/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/no-severity/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-source-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-source-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-source-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/no-source-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/no-source/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/no-source/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/test-source-directory-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/test-source-directory-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/test-source-directory-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/test-source-directory-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/no-source/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/no-source/checkstyle-result.xml</outputFile> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/useFile-plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/useFile-plugin-config.xml?rev=1780613&r1=1780612&r2=1780613&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/useFile-plugin-config.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/plugin-configs/useFile-plugin-config.xml Fri Jan 27 21:29:10 2017 @@ -30,7 +30,6 @@ under the License. <enableRSS>true</enableRSS> <includes>**/*.java</includes> <configLocation>sun_checks.xml</configLocation> - <format>sun</format> <headerLocation>${basedir}/src/test/test-sources/LICENSE.txt</headerLocation> <cacheFile>${basedir}/target/test-harness/checkstyle/useFile/checkstyle-cachefile</cacheFile> <outputFile>${basedir}/target/test-harness/checkstyle/useFile/checkstyle-result.xml</outputFile>