pmd/checkstyle plugins not finding multiple results files

33 views
Skip to first unread message

Derek Lewis

unread,
May 16, 2011, 7:22:09 PM5/16/11
to Jenkins Users
I have a fairly complex project here, with modules that are built with
ant, and some that are build with maven, as we continue to migrate to
maven3. I have a freestyle project that's using one big ant script to
call all the builds, and I have the PMD and checkstyle plugins
configured to pick up results files from both the ant and maven
builds, using an expression like the following:
**/build-stats/pmd/index.xml,**/mavenized-project-1/**/target/
pmd.xml,**/mavenized-project-2/**/target/pmd.xml

For whatever reason, the plugins are not finding any of the pmd.xml
files. The build screen says "PMD: 0 warnings from one PMD file.", or
occasionally from 2 PMD files.
Is there a way to enable some output from the PMD plugin to indicate
what file(s) it is picking up, and why it's not finding the others?

I'm using Jenkins 1.403 with pmd/checkstyle plugins 3.15.

Ullrich Hafner

unread,
May 17, 2011, 5:55:32 AM5/17/11
to jenkins...@googlegroups.com
Are these files all PMD result files?

Are there PMD messages in the console?

E.g. :

[PMD] Successfully parsed file /home/hudson/Hudson/jobs/Analysis Core (Maven)/workspace/target/pmd.xml of module Static Analysis Utilities with 3 warnings.
[PMD] Using set difference to compute new warnings
[PMD] Setting build status to UNSTABLE since total number of annotations exceeds the threshold 0: [HIGH, NORMAL, LOW]


Ulli

Derek Lewis

unread,
May 17, 2011, 12:18:32 PM5/17/11
to Jenkins Users
I've poked around in a workspace, and there are 41 pmd report files in
submodules of one of the mavenized projects:
$ ls mavenized-project-1/*/target/pmd.xml | wc -l
41
None of those are being picked up. The ones I've checked are pmd
report files. I don't get any errors from hudson about parsing them,
as I did when I added a "pmd.xml" that was actually an ant script.

My build page says "PMD: 1 warning from one PMD file." The raw output
of the build says:
[PMD] Collecting PMD analysis files...
[PMD] Using set difference to compute new warnings
[PMD] Setting build status to UNSTABLE since total number of
annotations exceeds the threshold 0: [HIGH, NORMAL, LOW]

There's no output about what files it's finding. I don't have the
"Detect modules" checkbox checked though, which it looks like you may,
based on the output? Surely I don't need that checked for it to
process multiple result files?

Ulli Hafner

unread,
May 17, 2011, 12:43:38 PM5/17/11
to jenkins...@googlegroups.com
Is this a build on the slave? Seems that logging of the parsed files is
only available on the master node.

Ulli

Derek Lewis

unread,
May 17, 2011, 4:41:05 PM5/17/11
to Jenkins Users
It is on a slave, yeah. After your reply, I just checked the master
log to see if it's logging the filenames. It doesn't seem to be, but
there is an exception:
java.lang.NoClassDefFoundError: hudson/plugins/pmd/util/model/Priority
at
hudson.plugins.cigame.rules.plugins.pmd.PmdRuleSet.loadRules(PmdRuleSet.java:
14)
at
hudson.plugins.cigame.rules.plugins.PluginRuleSet.getRules(PluginRuleSet.java:
48)
at hudson.plugins.cigame.model.ScoreCard.record(ScoreCard.java:
33)
at hudson.plugins.cigame.model.ScoreCard.record(ScoreCard.java:
51)
at
hudson.plugins.cigame.GamePublisher.perform(GamePublisher.java:45)
at hudson.tasks.BuildStepMonitor
$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild
$AbstractRunner.perform(AbstractBuild.java:644)
at hudson.model.AbstractBuild
$AbstractRunner.performAllBuildSteps(AbstractBuild.java:623)
at hudson.model.AbstractBuild
$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:168)
at hudson.model.Run.run(Run.java:1405)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)

I disabled the cigame plugin on that project, but now the links on the
left to the pmd/checkstyle results are gone, and it's still saying
"from one PMD file", and not reporting errors that are definitely in
the pmd.xml files.
I also don't see any logging in the master log to indicate what files
it's parsing.

Ulli Hafner

unread,
May 17, 2011, 5:16:18 PM5/17/11
to jenkins...@googlegroups.com
Sorry, my explanation was somewhat unclear. If the build runs on the
slave, then the files are not logged at all, neither on the slave nor
on the master. Can you run the build on the master?

I think the other problem is unrelated. Do you use the latest versions
of all the plugins (analysis-core)?

Ulli

Von meinem iPod gesendet

Derek Lewis

unread,
May 17, 2011, 5:35:55 PM5/17/11
to Jenkins Users
Ah, I see. Unfortunately, I can't run the build on the master without
a lot of work, since it doesn't have all the same tools installed.
I'm actually starting to believe it may be working now (though I'm not
sure what I changed that fixed it), because the developers fixed the
pmd errors I was using to test this.
I've created some more failures to test this with, and I'm waiting for
the (hour and a half long) build to finish.

I upgraded to 3.15 of the pmd plugin yesterday, along with whatever
version of analysis-core it automatically upgraded to.

Derek Lewis

unread,
May 17, 2011, 7:07:37 PM5/17/11
to Jenkins Users
Just to follow up, it does seem to be working now. The fix seems to
have been disabling the cigame plugin, though I'm not sure about that,
because someone was fixing the pmd/checkstyle errors in the code while
I was trying to get the Jenkins build to fail correctly. :)

Ullrich Hafner

unread,
May 18, 2011, 3:05:58 AM5/18/11
to jenkins...@googlegroups.com
Ok, good to see.

I will add some more logging for slave builds in the next release, so we
see some details if something is not working. I also try to install the
CI game plug-in on my machine to see if I introduced some
incompatibilities...

Ulli

Derek Lewis

unread,
May 18, 2011, 12:27:01 PM5/18/11
to Jenkins Users
Ok. We have version 1.7 of the CI game plugin, which may be quite
old.
Reply all
Reply to author
Forward
0 new messages