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




having problems with the scm plugin

2010-02-24 Thread Grant Lewis
As far as I can tell my configuration is correct, using Maven 2.2.1, scm 1.3 
and OS X 10.6.2. The relevant parts of my POM file are included. The tags are 
in my parent POM file so I expect the child project to inherit. I don't really 
understand the difference between connection and developerConnection so I set 
them both.

scm
connection
scm:svn:https://10.6.22.11/svn/icfdev/NE-FIMS/trunk
/connection
developerConnection
scm:svn:https://10.6.22.11/svn/icfdev/NE-FIMS/trunk
/developerConnection
/scm

plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-scm-plugin/artifactId
version1.3/version
configuration
username${svn.username}/username
password${svn.password}/password
/configuration
/plugin
/plugins

When I try to run mvn scm:checkout on a child project I observe the error shown 
below from the plug-in. I also tried adding connectionUrl in the 
configuration for the plugin but that didn't help, same error. Anyone have some 
ideas? I'm not having any problems with command-line svn, only the Maven svn 
integration. Thanks.

Grant

STACK TRACE
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot run checkout 
command : 
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot run checkout 
command : 
at 
org.apache.maven.scm.plugin.CheckoutMojo.checkout(CheckoutMojo.java:134)
at 
org.apache.maven.scm.plugin.CheckoutMojo.execute(CheckoutMojo.java:93)
at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.apache.maven.scm.ScmException: Can't load the scm provider.
at 
org.apache.maven.scm.plugin.AbstractScmMojo.getScmRepository(AbstractScmMojo.java:334)
at 
org.apache.maven.scm.plugin.CheckoutMojo.checkout(CheckoutMojo.java:112)
... 20 more
Caused by: java.lang.NullPointerException: You need to define a connectionUrl 
parameter
at 
org.apache.maven.scm.plugin.AbstractScmMojo.getConnectionUrl(AbstractScmMojo.java:222)
at 
org.apache.maven.scm.plugin.AbstractScmMojo.getScmRepository(AbstractScmMojo.java:271)
... 21 more
/STACK TRACE






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



Re: having problems with the scm plugin

2010-02-24 Thread Grant Lewis
The line breaks aren't the problem. I made some progress. I'm still a little 
confused by connectionUrl versus developerConnectionUrl but the following in my 
parent POM file finally worked for me. I never got developerConnectionUrl to 
work and I'm honestly not sure how the property is used by the plugin.

plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-scm-plugin/artifactId
version1.3/version
configuration

connectionUrlscm:svn:https://10.6.22.11/svn/icfdev/NE-FIMS/trunk/${project.artifactId}/connectionUrl
username${svn.username}/username
password${svn.password}/password
/configuration
/plugin
/plugins


On Feb 24, 2010, at 6:51 PM, Bastian Spanneberg wrote:

 Grant Lewis schrieb:
 As far as I can tell my configuration is correct, using Maven 2.2.1, scm 1.3 
 and OS X 10.6.2. The relevant parts of my POM file are included. The tags 
 are in my parent POM file so I expect the child project to inherit. I don't 
 really understand the difference between connection and developerConnection 
 so I set them both.
 When I try to run mvn scm:checkout on a child project I observe the error 
 shown below from the plug-in. I also tried adding connectionUrl in the 
 configuration for the plugin but that didn't help, same error. Anyone have 
 some ideas? I'm not having any problems with command-line svn, only the 
 Maven svn integration. Thanks.
 
 are these line breaks also in your pom, or just in this mail ? i remember 
 i've got problems once with a similar situation, just cannot remember if it 
 was with a scm connection url.
 
 
 -
 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