[ http://jira.codehaus.org/browse/MCHECKSTYLE-48?page=comments#action_69904 ] Dennis Lundberg commented on MCHECKSTYLE-48: --------------------------------------------
I also stumbled on this today. After some serious digging I found a workaround for it. If you add <headerLocation>config/maven-header.txt</headerLocation> to your configuration it works. Now, on to the real problem. It seems to be the "magical" Locator, that: "Checks a location string to for a resource, URL, or File that matches. If a resource or URL is found, then a local file is created with that locations contents." The problem here is the "location" which in this case is set to "LICENSE.txt" (i.e. the default value for headerLocation). Now, if your project does not contain such a file, the Locator tries to find this in some other magical way and downloads it if it finds it. In my case I ended up with the license file for "JSch 0.0.*" in target/checkstyle-header.txt! So check the contents of that file. And this is what debug tells us: [DEBUG] resolveLocation(LICENSE.txt, checkstyle-header.txt) [DEBUG] Location is not a URL. [DEBUG] Location is not a File. [DEBUG] Potential Resource: jar:file:/C:/Program/maven-2.0.5-SNAPSHOT/lib/jsch-0.1.24.jar!/LICENSE.txt A solution for the maven_checks problem would be to change the default value of headerFile to "config/maven-header.txt" if the user has configured the plugin to use "config/maven_checks.xml" > regression: report generation doesn't work while dealing with the header file > ----------------------------------------------------------------------------- > > Key: MCHECKSTYLE-48 > URL: http://jira.codehaus.org/browse/MCHECKSTYLE-48 > Project: Maven 2.x Checkstyle Plugin > Issue Type: Bug > Environment: Checkstyle 2.2-SNAPSHOT rev 419829. > Reporter: Jerome Lacoste > Priority: Blocker > Attachments: mvn.log > > > Configured as is: > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-checkstyle-plugin</artifactId> > <configuration> > <configLocation>config/maven_checks.xml</configLocation> > </configuration> > </plugin> > Checkstyle stopped working. I made a fresh svn update and mvn > checkstyle:checkstyle fails with: > [...] > Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot > initialize module TreeWalker - Cannot set property 'headerFile' in module > RegexpHeader to > '/home/jerome/Dev/OSS/perso/jar-info/target/checkstyle-header.txt': line 24 > in header specification is not a regular expression > at > com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:165) > at > com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:209) > at > org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(CheckstyleReport.java:729) > at > org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:490) > [...] > Caused by: org.apache.commons.beanutils.ConversionException: line 24 in > header specification is not a regular expression > at > com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.initHeaderRegexps(RegexpHeaderCheck.java:116) > at > com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.setHeaderFile(RegexpHeaderCheck.java:85) > ... 34 more > Full log attached. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira