You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Daniel Kulp (JIRA)" <ji...@codehaus.org> on 2011/08/19 21:52:32 UTC

[jira] Closed: (MCHECKSTYLE-159) Optional treeWalker.cacheFile property must not be required

     [ https://jira.codehaus.org/browse/MCHECKSTYLE-159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp closed MCHECKSTYLE-159.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.8

> Optional treeWalker.cacheFile property must not be required
> -----------------------------------------------------------
>
>                 Key: MCHECKSTYLE-159
>                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-159
>             Project: Maven 2.x Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.6, 2.7
>            Reporter: Karsten Tinnefeld
>            Assignee: Daniel Kulp
>             Fix For: 2.8
>
>
> Given a custom checkstyle configuration, checkstyle requires the property cacheFile to the TreeWalker module be configured, thus, the following configuration cannot go without the property line:
> <module name="Checker">
>   [...]
>   <module name="TreeWalker">
>     <property name="cacheFile" value="$\{cachefile\}"/>
>     [...]
>   </module>
>   [...]
> </module>
> In case it is omitted, the tool exits with the following stack trace (shortened, regarding version 2.6):
> [INFO] Error during page generation
> Embedded error: Error rendering Maven report: Failed during checkstyle execution
> missing key 'cacheFile' in TreeWalker
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error during page generation
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> 	at 
> [...]
> Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: missing key 'cacheFile' in TreeWalker
> 	at com.puppycrawl.tools.checkstyle.DefaultConfiguration.getAttribute(DefaultConfiguration.java:74)
> 	at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:270)
> 	... 28 more
> Due to checkstyle documentation, the property is optional, and no cachefile will be used in case it is not specified (cf. http://checkstyle.sourceforge.net/config.html#TreeWalker). Also, cacheFile can be specified in the pom, thus it should be substituted anyway.
> Workaround:
> Add <configuration/>-Entry
>   <propertyExpansion>
>     cacheFile=${project.build.directory}/checkstyle-cachefile
>   </propertyExpansion>
> and use the above property line and a special maven build version of the checkstyle configuration file.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira