Okay, the saga continues. I opted for configuring a second POM file to remove the dependency on the parent POM. Now the checkstyle plugin is only configured one time. All is good with the check but I still get the checkstyle report generated twice when I run mvn site. I turned on debug and nothing jumped out. I also run help:effective-pm and noticed an older version of the site plugin, 2.0-beta-7. I think the latest release for maven 2 is 2.3. I listed my second POM file for review. It's not a major issue but I'd like to get rid of the duplicate Checkstyle link in the HTML report generated by site.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>gov.va.vba.vbms</groupId> <artifactId>security-analysis</artifactId> <version>3.0-SNAPSHOT</version> <packaging>pom</packaging> <name>VBMS Security Analysis ${project.version}</name> <properties> <checkstyle.version>2.9.1</checkstyle.version> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.9.1</version> <dependencies> <dependency> <groupId>com.puppycrawl.tools</groupId> <artifactId>checkstyle</artifactId> <version>5.5</version> </dependency> <dependency> <groupId>gov.va.vba.vbms</groupId> <artifactId>vbms-tools</artifactId> <version>3.0-SNAPSHOT</version> <classifier>build</classifier> </dependency> </dependencies> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>${checkstyle.version}</version> <configuration> <configLocation> security-analysis-checkstyle.xml </configLocation> <packageNamesLocation> gov/va/vba/vbms/tools/build/vbms-checkstyle-packages.xml </packageNamesLocation> </configuration> </plugin> </plugins> </reporting> </project> Grant On Fri, Apr 13, 2012 at 4:12 AM, Joachim Van der Auwera <joac...@progs.be>wrote: > Could it be that you are empacted by > > http://jira.codehaus.org/**browse/MCHECKSTYLE-142<http://jira.codehaus.org/browse/MCHECKSTYLE-142> > > I guess not all maven properties are accessible in the checkstyle > configuration. Depending on how you defined the cacheFile or > checkstyle.cache.file properties, they may not be visible to checkstyle. > > Kind regards, > Joachim > > > > On 12-04-12 04:59, Wayne Fay wrote: > >> Disclaimer: I don't use Checkstyle as a primary component in my builds. >> >> <property name="cacheFile" value="${checkstyle.cache.**file}"/> >>> <property name="cacheFile" value="${cacheFile}"/> >>> >> Did you try leaving cacheFile out entirely? Did you try setting >> value=""? Samples at the Checkstyle site show >> value="target/cachefile", did you try that? >> >> not sure why the plugin is complaining about it. Appreciate any thoughts >>> before I opt for looking into the plugin source code. >>> >> ... >> >>> 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) >>> >> I doubt looking at the Maven checkstyle plugin source code will be >> much help. The stacktrace shows a root cause in >> com.puppycrawl.tools.**checkstyle which I assume is part of Checkstyle >> itself. And I further assume the plugin simply calls out to Checkstyle >> and provides configuration etc so it can run properly (which is how >> most plugins work, thin wrappers around a larger codebase to integrate >> the tool into Maven's build process). >> >> If you're looking at any source code, look at the Checkstyle source >> itself specifically DefaultConfiguration.**getAttribute() line 74. (But >> you'll need to figure out which version of the binary is being used.) >> >> You probably need to take this email over to the Checkstyle support >> channels directly since their code is throwing this exception, not >> Maven and not the plugin. >> >> Wayne >> >> ------------------------------**------------------------------**--------- >> To unsubscribe, e-mail: >> users-unsubscribe@maven.**apache.org<users-unsubscr...@maven.apache.org> >> For additional commands, e-mail: users-h...@maven.apache.org >> >> > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@maven.**apache.org<users-unsubscr...@maven.apache.org> > For additional commands, e-mail: users-h...@maven.apache.org > >