maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip van Laenen (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MCHECKSTYLE-159) Optional treeWalker.cacheFile property must not be required
Date Tue, 02 Aug 2011 13:55:42 GMT

    [ https://jira.codehaus.org/browse/MCHECKSTYLE-159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=274817#comment-274817
] 

Filip van Laenen commented on MCHECKSTYLE-159:
----------------------------------------------

There's a small type in the Checkstyle configuration: the value of the property should have
a capital F like this in order for the work-around to work:

<module name="Checker">
[...]
<module name="TreeWalker">
<property name="cacheFile" value="${cacheFile}"/>
[...]
</module>
[...]
</module>

> 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
>
> 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

        

Mime
View raw message