Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Joachim Van der Auwera

Could it be that you are empacted by

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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Grant Lewis
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;

modelVersion4.0.0/modelVersion

groupIdgov.va.vba.vbms/groupId
artifactIdsecurity-analysis/artifactId
version3.0-SNAPSHOT/version
packagingpom/packaging

nameVBMS Security Analysis ${project.version}/name

properties
checkstyle.version2.9.1/checkstyle.version
/properties

build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-checkstyle-plugin/artifactId
version2.9.1/version
dependencies
dependency
groupIdcom.puppycrawl.tools/groupId
artifactIdcheckstyle/artifactId
version5.5/version
/dependency
dependency
groupIdgov.va.vba.vbms/groupId
artifactIdvbms-tools/artifactId
version3.0-SNAPSHOT/version
classifierbuild/classifier
/dependency
/dependencies
/plugin
/plugins
/build

reporting
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-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.bewrote:

 Could it be that you are empacted by

 http://jira.codehaus.org/**browse/MCHECKSTYLE-142http://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.orgusers-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org



 

Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Wayne Fay
 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

Have you run mvn clean lately? Perhaps this is leftover from an old build.

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Grant Lewis
I always run a clean before I run site. It's not a leftover. The duplicate
is repeatable. Whatever is causing it is inherent in my configuration or
possibly some missing markup in my pom file. I'm not trying to compile
anything, just run the checkstyle check. The check and report look good
now. The only issue is the report duplication. I pasted the log statements
during an execution. You can clearly see it run the report twice...

[INFO] [site:site {execution: default-site}]
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with
org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating Checkstyle report--- Maven Checkstyle Plugin 2.9.1
[WARNING] File encoding has not been set, using platform encoding MacRoman,
i.e. build is platform dependent!
[INFO]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating Checkstyle report--- Maven Checkstyle Plugin 2.9.1
[WARNING] File encoding has not been set, using platform encoding MacRoman,
i.e. build is platform dependent!
[INFO]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating Plugin Management report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Mailing Lists report--- Maven Project Info Reports
Plugin 2.1
[INFO] Generating Continuous Integration report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Project License report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Project Team report--- Maven Project Info Reports
Plugin 2.1
[INFO] Generating Source Repository report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating About report--- Maven Project Info Reports Plugin
2.1
[INFO] Generating Issue Tracking report--- Maven Project Info Reports
Plugin 2.1
[INFO] Generating Project Summary report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Project Plugins report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Dependencies report--- Maven Project Info Reports
Plugin 2.1
[INFO]

[INFO] BUILD SUCCESSFUL
[INFO]

[INFO] Total time: 30 seconds
[INFO] Finished at: Fri Apr 13 10:12:27 EDT 2012
[INFO] Final Memory: 46M/138M

On Fri, Apr 13, 2012 at 10:15 AM, Wayne Fay wayne...@gmail.com wrote:

  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

 Have you run mvn clean lately? Perhaps this is leftover from an old
 build.

 Wayne

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Wayne Fay
 anything, just run the checkstyle check. The check and report look good
 now. The only issue is the report duplication. I pasted the log statements

Are you using Maven3? If so, you need to change the pom configuration a bit:
http://www.wakaleo.com/blog/292-site-generation-in-maven-3

If this is M2, we probably need specific help from someone who has
more knowledge about site/reports than I do. I just don't use the
generated site much myself.

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Grant Lewis
It's maven 2.2.1. I'm not overly familiar with site myself. I know maven
well but not the reporting plugins as much. I'm guessing a bug in the
checkstyle plugin but I can't say for sure. I dropped down to version 2.6
of the plugin, same version defined in our parent pom and the duplicate
report problem went away.

Grant

On Fri, Apr 13, 2012 at 10:59 AM, Wayne Fay wayne...@gmail.com wrote:

  anything, just run the checkstyle check. The check and report look good
  now. The only issue is the report duplication. I pasted the log
 statements

 Are you using Maven3? If so, you need to change the pom configuration a
 bit:
 http://www.wakaleo.com/blog/292-site-generation-in-maven-3

 If this is M2, we probably need specific help from someone who has
 more knowledge about site/reports than I do. I just don't use the
 generated site much myself.

 Wayne

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-13 Thread Robert Scholte
Since checkstyle-2.8 there's a second report: the  
checkstyle-aggregator-report[1]
This causes the the duplicate loglines for the checkstyle-plugin, one for  
each report.
My intuition would say that should always be only 1 report: the  
checkstyle-aggregator is for pom-packaged projects


Robert

[1]  
http://maven.apache.org/plugins/maven-checkstyle-plugin/checkstyle-aggregate-mojo.html


Op Fri, 13 Apr 2012 16:23:01 +0200 schreef Grant Lewis  
ukchuckt...@gmail.com:


I always run a clean before I run site. It's not a leftover. The  
duplicate

is repeatable. Whatever is causing it is inherent in my configuration or
possibly some missing markup in my pom file. I'm not trying to compile
anything, just run the checkstyle check. The check and report look good
now. The only issue is the report duplication. I pasted the log  
statements

during an execution. You can clearly see it run the report twice...

[INFO] [site:site {execution: default-site}]
[WARNING] No project URL defined - decoration links will not be  
relativized!

[INFO] Rendering site with
org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating Checkstyle report--- Maven Checkstyle Plugin  
2.9.1
[WARNING] File encoding has not been set, using platform encoding  
MacRoman,

i.e. build is platform dependent!
[INFO]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating Checkstyle report--- Maven Checkstyle Plugin  
2.9.1
[WARNING] File encoding has not been set, using platform encoding  
MacRoman,

i.e. build is platform dependent!
[INFO]
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating Plugin Management report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Mailing Lists report--- Maven Project Info  
Reports

Plugin 2.1
[INFO] Generating Continuous Integration report--- Maven Project  
Info

Reports Plugin 2.1
[INFO] Generating Project License report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Project Team report--- Maven Project Info Reports
Plugin 2.1
[INFO] Generating Source Repository report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating About report--- Maven Project Info Reports Plugin
2.1
[INFO] Generating Issue Tracking report--- Maven Project Info  
Reports

Plugin 2.1
[INFO] Generating Project Summary report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Project Plugins report--- Maven Project Info
Reports Plugin 2.1
[INFO] Generating Dependencies report--- Maven Project Info Reports
Plugin 2.1
[INFO]

[INFO] BUILD SUCCESSFUL
[INFO]

[INFO] Total time: 30 seconds
[INFO] Finished at: Fri Apr 13 10:12:27 EDT 2012
[INFO] Final Memory: 46M/138M

On Fri, Apr 13, 2012 at 10:15 AM, Wayne Fay wayne...@gmail.com wrote:


 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


Have you run mvn clean lately? Perhaps this is leftover from an old
build.

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Grant Lewis
I have tried all the recommended solutions thus far and none worked. The
exception is not coming from Checkstyle, at least not as far as I can tell.
I debugged the maven plugin (2.9.1) and I am using the latest checkstyle,
5.5. The call to executeReport in AbstractMavenReport is where the error is
thrown. The actual check process completed. I don't think this is a
checkstyle error but I'm not certain yet.

Grant

On Wed, Apr 11, 2012 at 10:59 PM, Wayne Fay wayne...@gmail.com 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-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Wayne Fay
 I have tried all the recommended solutions thus far and none worked. The
 exception is not coming from Checkstyle, at least not as far as I can tell.
 I debugged the maven plugin (2.9.1) and I am using the latest checkstyle,
 5.5. The call to executeReport in AbstractMavenReport is where the error is
 thrown. The actual check process completed. I don't think this is a
 checkstyle error but I'm not certain yet.

So you tried this? I found this in someone's bugzilla [1] and
supposedly it fixed their issue.
property name=cacheFile value=target/checkstyle-cachefile/

You may also find the m-checkstyle-p code interesting reading [2].

Is there an option to run Checkstyle via Ant? Perhaps call out to
antrun instead and let it run Checkstyle for you. Or just call
Checkstyle yourself from the command line with the proper config. At a
minimum, this would tell you if the problem is in m-checkstyle-p or in
the way your configuration file is written, so it is a good next step
IMO.

[1] http://www.smartics.eu/bugzilla/show_bug.cgi?id=468
[2] 
http://maven.apache.org/plugins/maven-checkstyle-plugin/xref/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.html#286

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Grant Lewis
Yes, I tried all the suggested solutions including that one. On a hunch I
went ahead and explicitly set the checkstyle version to 5.5 in the POM and
problem solved. I believe checkstyle 5.5 changed the method signatures on
some of the log methods and that was causing the issue during the report
generation. Here is what worked for me...

profiles
profile
idcheckstyle/id

build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-checkstyle-plugin/artifactId
version2.9.1/version
dependencies
dependency
groupIdcom.puppycrawl.tools/groupId
artifactIdcheckstyle/artifactId
version5.5/version
/dependency
dependency
groupId.../groupId
artifactId.../artifactId
version3.0-SNAPSHOT/version
classifierbuild/classifier
/dependency
/dependencies
/plugin
/plugins
/build
reporting
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-checkstyle-plugin/artifactId
version2.9.1/version
configuration
configLocationcheckstyle.xml/configLocation
failsOnErrorfalse/failsOnError

packageNamesLocationgov/va/vba/vbms/tools/build/vbms-checkstyle-packages.xml/packageNamesLocation
/configuration
/plugin
/plugins
/reporting
/profile
/profiles

On Thu, Apr 12, 2012 at 1:50 PM, Wayne Fay wayne...@gmail.com wrote:

  I have tried all the recommended solutions thus far and none worked. The
  exception is not coming from Checkstyle, at least not as far as I can
 tell.
  I debugged the maven plugin (2.9.1) and I am using the latest checkstyle,
  5.5. The call to executeReport in AbstractMavenReport is where the error
 is
  thrown. The actual check process completed. I don't think this is a
  checkstyle error but I'm not certain yet.

 So you tried this? I found this in someone's bugzilla [1] and
 supposedly it fixed their issue.
 property name=cacheFile value=target/checkstyle-cachefile/

 You may also find the m-checkstyle-p code interesting reading [2].

 Is there an option to run Checkstyle via Ant? Perhaps call out to
 antrun instead and let it run Checkstyle for you. Or just call
 Checkstyle yourself from the command line with the proper config. At a
 minimum, this would tell you if the problem is in m-checkstyle-p or in
 the way your configuration file is written, so it is a good next step
 IMO.

 [1] http://www.smartics.eu/bugzilla/show_bug.cgi?id=468
 [2]
 http://maven.apache.org/plugins/maven-checkstyle-plugin/xref/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.html#286

 Wayne

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Barrie Treloar
On Fri, Apr 13, 2012 at 3:29 AM, Grant Lewis ukchuckt...@gmail.com wrote:
 Yes, I tried all the suggested solutions including that one. On a hunch I
 went ahead and explicitly set the checkstyle version to 5.5 in the POM and
 problem solved. I believe checkstyle 5.5 changed the method signatures on
 some of the log methods and that was causing the issue during the report
 generation. Here is what worked for me...

Running mvn -X would have told you (in great verbosage) what version
of plugins were being loaded.

And you would have noticed that m-checkstyle-p was not 5.5.

It is best practice to lock down version of plugins.

Use The Loving Iron Fist of Maven, aka m-enforcer-p to fail your
build when someone forgets to specify a plugin version.

Your release manager will thank you.
A sainthood is a real possibility.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Grant Lewis
Thanks for the tip on -X, I always forget the debug option.

I have a related question. The checkstyle report is running twice and I end
up with two links in the project-reports html file with the same data. Any
thoughts on why that might be happening? I haven't started debugging that
one yet.

Grant

On Thu, Apr 12, 2012 at 6:40 PM, Barrie Treloar baerr...@gmail.com wrote:

 On Fri, Apr 13, 2012 at 3:29 AM, Grant Lewis ukchuckt...@gmail.com
 wrote:
  Yes, I tried all the suggested solutions including that one. On a hunch I
  went ahead and explicitly set the checkstyle version to 5.5 in the POM
 and
  problem solved. I believe checkstyle 5.5 changed the method signatures on
  some of the log methods and that was causing the issue during the report
  generation. Here is what worked for me...

 Running mvn -X would have told you (in great verbosage) what version
 of plugins were being loaded.

 And you would have noticed that m-checkstyle-p was not 5.5.

 It is best practice to lock down version of plugins.

 Use The Loving Iron Fist of Maven, aka m-enforcer-p to fail your
 build when someone forgets to specify a plugin version.

 Your release manager will thank you.
 A sainthood is a real possibility.

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Barrie Treloar
On Fri, Apr 13, 2012 at 9:12 AM, Grant Lewis ukchuckt...@gmail.com wrote:
 Thanks for the tip on -X, I always forget the debug option.

 I have a related question. The checkstyle report is running twice and I end
 up with two links in the project-reports html file with the same data. Any
 thoughts on why that might be happening? I haven't started debugging that
 one yet.

Run
   mvn help:effective-pom

Does your parent pom also define checkstyle - perhaps with a different version?

I suspect that it is listed twice in the reporting section.

Just guesses

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Grant Lewis
yeah, I thought the same thing and just checked it before reading your
e-mail. It's in there. Our project is big so I can't fiddle too much with
the parent POM and I don't want to roll my check into the main surefire
report. The custom check is used as an on-demand static code analysis to
identify public methods in our business tier that are missing
security-related annotations. I'd rather override the parent with my
config, not the union I'm getting now. If all else fails I'll create a new
module that doesn't inherit from our standard parent.

Grant

On Thu, Apr 12, 2012 at 7:53 PM, Barrie Treloar baerr...@gmail.com wrote:

 On Fri, Apr 13, 2012 at 9:12 AM, Grant Lewis ukchuckt...@gmail.com
 wrote:
  Thanks for the tip on -X, I always forget the debug option.
 
  I have a related question. The checkstyle report is running twice and I
 end
  up with two links in the project-reports html file with the same data.
 Any
  thoughts on why that might be happening? I haven't started debugging that
  one yet.

 Run
   mvn help:effective-pom

 Does your parent pom also define checkstyle - perhaps with a different
 version?

 I suspect that it is listed twice in the reporting section.

 Just guesses

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Barrie Treloar
On Fri, Apr 13, 2012 at 9:58 AM, Grant Lewis ukchuckt...@gmail.com wrote:
 yeah, I thought the same thing and just checked it before reading your
 e-mail. It's in there. Our project is big so I can't fiddle too much with
 the parent POM and I don't want to roll my check into the main surefire
 report. The custom check is used as an on-demand static code analysis to
 identify public methods in our business tier that are missing
 security-related annotations. I'd rather override the parent with my
 config, not the union I'm getting now. If all else fails I'll create a new
 module that doesn't inherit from our standard parent.

You could roll a fresh pom named something else, like static-analysis-pom.xml.
And frankenstein enough of it together to just do the checkstyle
checks you want.
I'd then check that into your CI tool and run it on checkins or nightly.
Then not worry about it again.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Grant Lewis
Good idea to roll the second pom file. I like it, thanks!

Grant

On Thu, Apr 12, 2012 at 9:17 PM, Barrie Treloar baerr...@gmail.com wrote:

 On Fri, Apr 13, 2012 at 9:58 AM, Grant Lewis ukchuckt...@gmail.com
 wrote:
  yeah, I thought the same thing and just checked it before reading your
  e-mail. It's in there. Our project is big so I can't fiddle too much with
  the parent POM and I don't want to roll my check into the main surefire
  report. The custom check is used as an on-demand static code analysis to
  identify public methods in our business tier that are missing
  security-related annotations. I'd rather override the parent with my
  config, not the union I'm getting now. If all else fails I'll create a
 new
  module that doesn't inherit from our standard parent.

 You could roll a fresh pom named something else, like
 static-analysis-pom.xml.
 And frankenstein enough of it together to just do the checkstyle
 checks you want.
 I'd then check that into your CI tool and run it on checkins or nightly.
 Then not worry about it again.

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Wayne Fay
  security-related annotations. I'd rather override the parent with my
 config, not the union I'm getting now. If all else fails I'll create a new
 module that doesn't inherit from our standard parent.

You may want to specify combine.self=override in that case...
http://www.sonatype.com/people/2011/01/maven-how-to-merging-plugin-configuration-in-complex-projects/

Wayne

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-12 Thread Barrie Treloar
On Fri, Apr 13, 2012 at 1:02 PM, Wayne Fay wayne...@gmail.com wrote:
  security-related annotations. I'd rather override the parent with my
 config, not the union I'm getting now. If all else fails I'll create a new
 module that doesn't inherit from our standard parent.

 You may want to specify combine.self=override in that case...
 http://www.sonatype.com/people/2011/01/maven-how-to-merging-plugin-configuration-in-complex-projects/

Ooo, I forgot about that.
Its a useful thing to have in your toolbox.

In this case because the checkstyle plugin versions are different its
possible combining sections may not be the cleanest or most obvious to
future readers of the pom file what is happening.
YMMV.

As per the blog post, you may need multiple combines to get the desired result.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-11 Thread Wayne Fay
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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Missing key cacheFile, checkstyle plugin, custom check class

2012-04-11 Thread Barrie Treloar
On Thu, Apr 12, 2012 at 12:29 PM, Wayne Fay wayne...@gmail.com 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?

Are you running into http://jira.codehaus.org/browse/MCHECKSTYLE-159?

While I use Checkstyle, I have never set cacheFile myself and not sure
why you would.

In order to use the magic of property expansion, i.e. ${}, you need to
add a configuration section to the checkstyle plugin as documented in
the above JIRA, and define the key/vale pair for the expansion.
BEWARE: the comments in the Jira have a typo for the expansion, which
someone notes in a sub-comment.

Are you using the latest version of the checkstyle plugin?

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org