Author: dennisl Date: Wed Oct 14 19:52:51 2009 New Revision: 825243 URL: http://svn.apache.org/viewvc?rev=825243&view=rev Log: [MCHECKSTYLE-105] Update to Checkstyle 5.0 Submitted by: Felix Röthenbacher, Ben Speakmon and Max Berger Reviewed by: Dennis Lundberg
Modified: maven/plugins/trunk/maven-checkstyle-plugin/pom.xml maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/avalon_checks.xml maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/turbine_checks.xml maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/examples/custom-developed-checkstyle.apt.vm maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleResultsTest.java Modified: maven/plugins/trunk/maven-checkstyle-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/pom.xml?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/pom.xml Wed Oct 14 19:52:51 2009 @@ -170,12 +170,7 @@ <dependency> <groupId>checkstyle</groupId> <artifactId>checkstyle</artifactId> - <version>4.4</version> - </dependency> - <dependency> - <groupId>checkstyle</groupId> - <artifactId>checkstyle-optional</artifactId> - <version>4.4</version> + <version>5.0</version> </dependency> <!-- misc --> @@ -233,7 +228,7 @@ </execution> </executions> </plugin> - </plugins> + </plugins> </build> <profiles> @@ -285,10 +280,20 @@ --> <version>${pom.version}</version> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>2.5.1</version> + <configuration> + <requirements> + <jdk>1.5</jdk> + </requirements> + </configuration> + </plugin> </plugins> </reporting> </profile> - + <profile> <id>maven-3</id> <activation> @@ -300,7 +305,7 @@ <properties> <sitePluginVersion>3.0-beta-1-SNAPSHOT</sitePluginVersion> </properties> - </profile> - + </profile> + </profiles> </project> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Wed Oct 14 19:52:51 2009 @@ -23,7 +23,6 @@ import com.puppycrawl.tools.checkstyle.ConfigurationLoader; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.DefaultLogger; -import com.puppycrawl.tools.checkstyle.ModuleFactory; import com.puppycrawl.tools.checkstyle.PackageNamesLoader; import com.puppycrawl.tools.checkstyle.PropertiesExpander; import com.puppycrawl.tools.checkstyle.XMLLogger; @@ -79,6 +78,7 @@ import java.util.Map; import java.util.Properties; import java.util.ResourceBundle; +import java.util.Set; /** * Perform a Checkstyle analysis, and generate a report on violations. @@ -594,12 +594,9 @@ String configFile = getConfigFile(); Properties overridingProperties = getOverridingProperties(); - ModuleFactory moduleFactory; Configuration config; CheckstyleResults results; - moduleFactory = getModuleFactory(); - config = ConfigurationLoader.loadConfiguration( configFile, new PropertiesExpander( overridingProperties ) ); String effectiveEncoding = @@ -614,8 +611,8 @@ for ( int i = 0; i < modules.length; i++ ) { Configuration module = modules[i]; - if ( "TreeWalker".equals( module.getName() ) - || "com.puppycrawl.tools.checkstyle.TreeWalker".equals( module.getName() ) ) + if ( "Checker".equals( module.getName() ) + || "com.puppycrawl.tools.checkstyle.Checker".equals( module.getName() ) ) { if ( module instanceof DefaultConfiguration ) { @@ -626,13 +623,25 @@ getLog().warn( "Failed to configure file encoding on module " + module ); } } + if ("TreeWalker".equals(module.getName()) + || "com.puppycrawl.tools.checkstyle.TreeWalker".equals(module.getName())) + { + if (module instanceof DefaultConfiguration) + { + ((DefaultConfiguration) module).addAttribute("cacheFile", cacheFile); + } + else + { + getLog().warn("Failed to configure cache file on module " + module); + } + } } - results = executeCheckstyle( config, moduleFactory ); + results = executeCheckstyle( config ); ResourceBundle bundle = getBundle( locale ); generateReportStatics(); - generateMainReport( results, config, moduleFactory, bundle ); + generateMainReport( results, config, bundle ); if ( enableRSS ) { CheckstyleRssGeneratorRequest request = @@ -689,8 +698,7 @@ return copyright; } - private void generateMainReport( CheckstyleResults results, Configuration config, ModuleFactory moduleFactory, - ResourceBundle bundle ) + private void generateMainReport( CheckstyleResults results, Configuration config, ResourceBundle bundle ) { CheckstyleReportGenerator generator = new CheckstyleReportGenerator( getSink(), bundle, project.getBasedir(), siteTool ); @@ -700,7 +708,6 @@ generator.setEnableFilesSummary( enableFilesSummary ); generator.setEnableRSS( enableRSS ); generator.setCheckstyleConfig( config ); - generator.setCheckstyleModuleFactory( moduleFactory ); if ( linkXRef ) { String relativePath = PathTool.getRelativePath( getOutputDirectory(), xrefLocation.getAbsolutePath() ); @@ -783,7 +790,7 @@ } } - private CheckstyleResults executeCheckstyle( Configuration config, ModuleFactory moduleFactory ) + private CheckstyleResults executeCheckstyle( Configuration config ) throws MavenReportException, CheckstyleException { File[] files; @@ -863,10 +870,7 @@ URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null ); checker.setClassloader( projectClassLoader ); - if ( moduleFactory != null ) - { - checker.setModuleFactory( moduleFactory ); - } + checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() ); if ( filterSet != null ) { @@ -896,7 +900,11 @@ checker.addListener( sinkListener ); - int nbErrors = checker.process( files ); + ArrayList filesList = new ArrayList(); + for (int i = 0; i < files.length; i++) { + filesList.add(files[i]); + } + int nbErrors = checker.process( filesList ); checker.destroy(); @@ -1106,31 +1114,6 @@ } - private ModuleFactory getModuleFactory() - throws CheckstyleException - { - // default to internal module factory. - ModuleFactory moduleFactory = PackageNamesLoader.loadModuleFactory( Thread.currentThread() - .getContextClassLoader() ); - - try - { - // attempt to locate any specified package file. - File packageNamesFile = locator.resolveLocation( packageNamesLocation, "checkstyle-packages.xml" ); - - if ( packageNamesFile != null ) - { - // load resolved location. - moduleFactory = PackageNamesLoader.loadModuleFactory( packageNamesFile.getAbsolutePath() ); - } - } - catch ( IOException e ) - { - getLog().error( "Unable to process package names location: " + packageNamesLocation, e ); - } - return moduleFactory; - } - private String getSuppressionLocation() throws MavenReportException { Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java Wed Oct 14 19:52:51 2009 @@ -19,7 +19,7 @@ * under the License. */ -import com.puppycrawl.tools.checkstyle.ModuleFactory; +import com.puppycrawl.tools.checkstyle.Checker; import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; @@ -58,8 +58,6 @@ private Configuration checkstyleConfig; - private ModuleFactory checkstyleModuleFactory; - private boolean enableRulesSummary; private boolean enableSeveritySummary; @@ -71,7 +69,7 @@ private SiteTool siteTool; private String xrefLocation; - + public CheckstyleReportGenerator( Sink sink, ResourceBundle bundle, File basedir, SiteTool siteTool ) { this.bundle = bundle; @@ -524,17 +522,6 @@ private String countRuleViolation( Iterator files, String ruleName, String message, String severity ) { long count = 0; - String sourceName; - - try - { - sourceName = checkstyleModuleFactory.createModule( ruleName ).getClass().getName(); - } - catch ( CheckstyleException e ) - { - getLog().error( "Unable to obtain Source Name for Rule '" + ruleName + "'.", e ); - return "(report failure)"; - } while ( files.hasNext() ) { @@ -544,7 +531,10 @@ { AuditEvent event = (AuditEvent) error.next(); - if ( event.getSourceName().equals( sourceName ) ) + String eventSrcName = event.getSourceName(); + if ( eventSrcName != null + && ( eventSrcName.endsWith( ruleName ) + || eventSrcName.endsWith( ruleName + "Check" ) ) ) { // check message too, for those that have a specific one. // like GenericIllegalRegexp and Regexp @@ -578,7 +568,6 @@ } } } - return String.valueOf( count ); } @@ -884,13 +873,4 @@ this.checkstyleConfig = config; } - public ModuleFactory getCheckstyleModuleFactory() - { - return checkstyleModuleFactory; - } - - public void setCheckstyleModuleFactory( ModuleFactory checkstyleModuleFactory ) - { - this.checkstyleModuleFactory = checkstyleModuleFactory; - } } Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/avalon_checks.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/avalon_checks.xml?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/avalon_checks.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/avalon_checks.xml Wed Oct 14 19:52:51 2009 @@ -51,9 +51,11 @@ <module name="Checker"> - <!-- Checks that a package.html file exists for each package. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> - <module name="PackageHtml"/> + <!-- Checks that each Java package has a Javadoc file used for commenting. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> + <module name="JavadocPackage"> + <property name="allowLegacy" value="true"/> + </module> <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> @@ -63,6 +65,21 @@ <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <module name="Translation"/> + <module name="FileLength"/> + + <!-- Following interprets the header file as regular expressions. --> + <!-- <module name="RegexpHeader"/> --> + + <module name="FileTabCharacter"> + <property name="eachLine" value="true"/> + </module> + + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> + <module name="TreeWalker"> <property name="cacheFile" value="${checkstyle.cache.file}"/> @@ -122,10 +139,6 @@ <property name="headerFile" value="${checkstyle.header.file}"/> </module> - <!-- Following interprets the header file as regular expressions. --> - <!-- <module name="RegexpHeader"/> --> - - <!-- Checks for imports --> <!-- See http://checkstyle.sf.net/config_import.html --> <module name="AvoidStarImport"/> @@ -136,7 +149,6 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="FileLength"/> <module name="LineLength"/> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -149,7 +161,6 @@ <module name="NoWhitespaceBefore"/> <module name="OperatorWrap"/> <module name="ParenPad"/> - <module name="TabCharacter"/> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"/> @@ -196,10 +207,6 @@ <!-- See http://checkstyle.sf.net/config_misc.html --> <module name="ArrayTypeStyle"/> <module name="FinalParameters"/> - <module name="GenericIllegalRegexp"> - <property name="format" value="\s+$"/> - <property name="message" value="Line has trailing spaces."/> - </module> <module name="TodoComment"/> <module name="UpperEll"/> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml Wed Oct 14 19:52:51 2009 @@ -28,9 +28,11 @@ <module name="Checker"> - <!-- Checks that a package.html file exists for each package. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> - <!-- module name="PackageHtml"/ --> + <!-- Checks that each Java package has a Javadoc file used for commenting. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> + <module name="JavadocPackage"> + <property name="allowLegacy" value="true"/> + </module> <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> @@ -40,6 +42,24 @@ <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <!-- module name="Translation"/ --> + <module name="FileLength"/> + + <!-- Checks for Headers --> + <!-- See http://checkstyle.sf.net/config_header.html --> + <module name="RegexpHeader"> + <property name="headerFile" value="${checkstyle.header.file}"/> + </module> + + <module name="FileTabCharacter"> + <property name="eachLine" value="true"/> + </module> + + <!-- Line with trailing spaces (disabled as it's too noisy) --> + <!--<module name="RegexpSingleline"> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module>--> + <module name="TreeWalker"> <property name="cacheFile" value="${checkstyle.cache.file}"/> @@ -87,13 +107,6 @@ <module name="StaticVariableName"/> <module name="TypeName"/> - - <!-- Checks for Headers --> - <!-- See http://checkstyle.sf.net/config_header.html --> - <module name="RegexpHeader"> - <property name="headerFile" value="${checkstyle.header.file}"/> - </module> - <!-- Checks for imports --> <!-- See http://checkstyle.sf.net/config_import.html --> <module name="AvoidStarImport"/> @@ -104,7 +117,6 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="FileLength"/> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -120,7 +132,6 @@ <module name="ParenPad"> <property name="option" value="space" /> </module> - <module name="TabCharacter"/> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"/> <!-- module name="MethodParamPad"/ --> @@ -178,12 +189,6 @@ <!-- See http://checkstyle.sf.net/config_misc.html --> <!-- module name="ArrayTypeStyle"/ --> <!-- module name="FinalParameters"/ --> - <!-- Line with Trailing Spaces (disabled as it's to noisy) - <module name="GenericIllegalRegexp"> - <property name="format" value="\s+$"/> - <property name="message" value="Line has trailing spaces."/> - </module> - --> <!-- Let todo plugin handle this. <module name="TodoComment"/> --> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/sun_checks.xml Wed Oct 14 19:52:51 2009 @@ -1,23 +1,4 @@ <?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 module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> @@ -50,10 +31,19 @@ --> <module name="Checker"> - - <!-- Checks that a package.html file exists for each package. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> - <module name="PackageHtml"/> + <!-- + If you set the basedir property below, then all reported file + names will be relative to the specified directory. See + http://checkstyle.sourceforge.net/5.x/config.html#Checker + + <property name="basedir" value="${basedir}"/> + --> + + <!-- Checks that each Java package has a Javadoc file used for commenting. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> + <module name="JavadocPackage"> + <property name="allowLegacy" value="true"/> + </module> <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> @@ -63,6 +53,20 @@ <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <module name="Translation"/> + <module name="FileLength"/> + + <!-- Following interprets the header file as regular expressions. --> + <!-- <module name="RegexpHeader"/> --> + + <module name="FileTabCharacter"> + <property name="eachLine" value="true"/> + </module> + + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> <module name="TreeWalker"> @@ -103,9 +107,6 @@ <!-- value="${basedir}/java.header"/> --> <!-- </module> --> - <!-- Following interprets the header file as regular expressions. --> - <!-- <module name="RegexpHeader"/> --> - <!-- Checks for imports --> <!-- See http://checkstyle.sf.net/config_import.html --> @@ -117,7 +118,6 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="FileLength"/> <module name="LineLength"/> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -132,7 +132,6 @@ <module name="OperatorWrap"/> <module name="ParenPad"/> <module name="TypecastParenPad"/> - <module name="TabCharacter"/> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"/> @@ -180,10 +179,6 @@ <!-- See http://checkstyle.sf.net/config_misc.html --> <module name="ArrayTypeStyle"/> <module name="FinalParameters"/> - <module name="GenericIllegalRegexp"> - <property name="format" value="\s+$"/> - <property name="message" value="Line has trailing spaces."/> - </module> <module name="TodoComment"/> <module name="UpperEll"/> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/turbine_checks.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/turbine_checks.xml?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/turbine_checks.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/turbine_checks.xml Wed Oct 14 19:52:51 2009 @@ -51,9 +51,11 @@ <module name="Checker"> - <!-- Checks that a package.html file exists for each package. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml --> - <module name="PackageHtml"/> + <!-- Checks that each Java package has a Javadoc file used for commenting. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> + <module name="JavadocPackage"> + <property name="allowLegacy" value="true"/> + </module> <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> @@ -63,6 +65,21 @@ <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <module name="Translation"/> + <module name="FileLength"/> + + <!-- Following interprets the header file as regular expressions. --> + <!-- <module name="RegexpHeader"/> --> + + <module name="FileTabCharacter"> + <property name="eachLine" value="true"/> + </module> + + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="Line has trailing spaces."/> + </module> + <module name="TreeWalker"> <property name="cacheFile" value="${checkstyle.cache.file}"/> @@ -118,10 +135,6 @@ <property name="ignoreLines" value="1,6"/> </module> - <!-- Following interprets the header file as regular expressions. --> - <!-- <module name="RegexpHeader"/> --> - - <!-- Checks for imports --> <!-- See http://checkstyle.sf.net/config_import.html --> <module name="AvoidStarImport"/> @@ -132,7 +145,6 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="FileLength"/> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -144,7 +156,6 @@ <module name="NoWhitespaceBefore"/> <module name="OperatorWrap"/> <module name="ParenPad"/> - <module name="TabCharacter"/> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"/> @@ -191,10 +202,6 @@ <!-- See http://checkstyle.sf.net/config_misc.html --> <module name="ArrayTypeStyle"/> <module name="FinalParameters"/> - <module name="GenericIllegalRegexp"> - <property name="format" value="\s+$"/> - <property name="message" value="Line has trailing spaces."/> - </module> <module name="TodoComment"/> <module name="UpperEll"/> 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=825243&r1=825242&r2=825243&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 Wed Oct 14 19:52:51 2009 @@ -75,7 +75,7 @@ <dependency> <groupId>checkstyle</groupId> <artifactId>checkstyle</artifactId> - <version>4.4</version> + <version>${project.version}</version> </dependency> </dependencies> </project> Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt Wed Oct 14 19:52:51 2009 @@ -31,7 +31,7 @@ The Checkstyle Plugin generates a report regarding the code style used by the developers. For more information about Checkstyle, see {{{http://checkstyle.sourceforge.net/}http://checkstyle.sourceforge.net/}}. - This version of the plugin uses Checkstyle 4.4. + This version of the plugin uses Checkstyle 5.0. The plugin can be configured in the project's POM. Predefined rulesets are included with the plugin, these are: <<<sun_checks.xml>>>, <<<turbine_checks.xml>>>, <<<avalon_checks.xml>>> and <<<maven_checks.xml>>>. You can also use a custom ruleset by Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java Wed Oct 14 19:52:51 2009 @@ -67,20 +67,20 @@ AuditEvent event = new AuditEvent( this, "/source/path/file1", null ); fireFileStarted( event ); - LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass() ); + LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null ); fireAddError( new AuditEvent( this, "/source/path/file1", message ) ); fireFileFinished( event ); event = new AuditEvent( this, "/source/path/file2", null ); fireFileStarted( event ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null ); fireAddError( new AuditEvent( this, "/source/path/file2", message ) ); fireAddError( new AuditEvent( this, "/source/path/file2", message ) ); fireFileFinished( event ); event = new AuditEvent( this, "/source/path/file3", null ); fireFileStarted( event ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null ); fireAddError( new AuditEvent( this, "/source/path/file3", message ) ); fireAddError( new AuditEvent( this, "/source/path/file3", message ) ); fireAddError( new AuditEvent( this, "/source/path/file3", message ) ); @@ -88,7 +88,7 @@ event = new AuditEvent( this, "/source/path/file4", null ); fireFileStarted( event ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null ); fireAddError( new AuditEvent( this, "/source/path/file4", message ) ); fireAddError( new AuditEvent( this, "/source/path/file4", message ) ); fireAddError( new AuditEvent( this, "/source/path/file4", message ) ); Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleResultsTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleResultsTest.java?rev=825243&r1=825242&r2=825243&view=diff ============================================================================== --- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleResultsTest.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleResultsTest.java Wed Oct 14 19:52:51 2009 @@ -75,24 +75,24 @@ { Map files = new HashMap(); - LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass() ); + LocalizedMessage message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.INFO, null, getClass(), null ); AuditEvent event = new AuditEvent( this, "file1", message ); files.put( "file1", Collections.singletonList( event ) ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.WARNING, null, getClass(), null ); List events = new ArrayList(); events.add( new AuditEvent( this, "file2", message ) ); events.add( new AuditEvent( this, "file2", message ) ); files.put( "file2", events ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.ERROR, null, getClass(), null ); events = new ArrayList(); events.add( new AuditEvent( this, "file3", message ) ); events.add( new AuditEvent( this, "file3", message ) ); events.add( new AuditEvent( this, "file3", message ) ); files.put( "file3", events ); - message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass() ); + message = new LocalizedMessage( 0, 0, "", "", null, SeverityLevel.IGNORE, null, getClass(), null ); events = new ArrayList(); events.add( new AuditEvent( this, "file4", message ) ); events.add( new AuditEvent( this, "file4", message ) );