Hi,
i slightly changed your pom.xml. A small java source in the default
package under src/main/java shows up fine in all reports.
regards
Dirk
PS: Using the following command line
'mvn clean package pmd:pmd checkstyle:checkstyle findbugs:findbugs'
that is.
On 04.10.2012 22:11, Rob Withers wrote:
> I am attaching the 3 config files for analysis where I changed the file
> references to the project root. I still have the error below:
>
> Caused by: java.io.FileNotFoundException:
> C:\rob\comp\workspace\murmur-events\target\checkstyle-suppressions.xml
>
>
> Rob
>
>
> -----Original Message----- From: Rob Withers
> Sent: Thursday, October 04, 2012 3:59 PM
> To: [email protected]
> Subject: Re: no code analysis showing up with my builds
>
> I fixed the JUnit issue.
>
> I thought this section of the POM specified the etc directory:
>
> <build>
> <defaultGoal>install</defaultGoal>
>
> <resources>
> <resource>
> <directory>etc</directory>
> <filtering>true</filtering>
> </resource>
> </resources>
>
> ...
>
> </build>
>
>
> "I think the setup used in the analysis-plugin family does not play well
> with your use case (one project with analysis configuration within the
> project)."
>
> hmm. Ok. I moved the xml files for analysis to the directory where the
> pom.xml is and removed the etc directory and removed the <resources> tag
> section from the pom.xml. Ran it again and got this error:
>
> Caused by: java.io.FileNotFoundException:
> C:\rob\comp\workspace\murmur-events\target\checkstyle-suppressions.xml
>
> I looked in the target subdirectory and the analysis xml files are not
> there.
>
> How should I configure analysis?
>
> Thanks,
> Rob
>
> -----Original Message----- From: Dirk Weigenand
> Sent: Thursday, October 04, 2012 3:25 PM
> To: [email protected]
> Subject: Re: no code analysis showing up with my builds
>
> Hi,
>
> prefix your configuration files with 'etc/'.
>
> I think the setup used in the analysis-plugin family does not play well
> with your use case (one project with analysis configuration within the
> project).
>
> regards
>
> Dirk
>
> On 04.10.2012 19:56, Rob Withers wrote:
>> I am now getting this error:
>>
>> Caused by:
>> org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could not
>> find resource 'checkstyle-configuration.xml'.
>>
>> I am attaching my pom.xml and the xml config files for the analysis
>> tools are in the folder 'etc'. I think that is everything to describe
>> my setup...
>>
>> Rob
>>
>> -----Original Message----- From: Dirk Weigenand
>> Sent: Thursday, October 04, 2012 8:24 AM
>> To: [email protected]
>> Subject: Re: no code analysis showing up with my builds
>>
>> Hi,
>>
>> just copy over the relevant parts of the pom.xml
>>
>> <build>
>> ...
>> <resources>
>> <resource>
>> <directory>etc</directory>
>> <filtering>true</filtering>
>> </resource>
>> </resources>
>> <pluginManagement>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-resources-plugin</artifactId>
>> <version>2.4.3</version>
>> <configuration>
>> <encoding>${source.encoding}</encoding>
>> </configuration>
>> </plugin>
>> </plugins>
>> </pluginManagement>
>> </build>
>>
>> and don't forget the configuration files located in the 'etc' folder
>> (*configuration.xml).
>>
>> regards
>>
>> Dirk
>>
>> On 04.10.2012 14:04, Rob Withers wrote:
>>> Hi Dirk,
>>>
>>> I took a little time and looked at this. It doesn't look like a good
>>> example of the use of the POM to reference these tools. Is there a
>>> better example that has a POM setup to use these tools? I poked around
>>> a bit but I did not find anything.
>>>
>>> Rob
>>>
>>> -----Original Message----- From: Dirk Weigenand
>>> Sent: Thursday, October 04, 2012 7:42 AM
>>> To: [email protected]
>>> Subject: Re: no code analysis showing up with my builds
>>>
>>> Hi,
>>>
>>> have a look at how the analysis-plugin family is structured. All plugins
>>> depend on this plugin:
>>>
>>> https://github.com/jenkinsci/analysis-config-plugin
>>>
>>> which holds the configuration for the various maven static source code
>>> analysis plugins used throughout the build.
>>>
>>> regards
>>>
>>> Dirk
>>>
>>> On 04.10.2012 13:23, Rob Withers wrote:
>>>> Ok, I removed the zips and harvested the plugins from your POM. I
>>>> removed the dependencies sections.
>>>>
>>>> Issue 1: when I go to the cli and run
>>>> 1) mvn findbugs:findbugs
>>>> 2) mvn checkstyle:checkstyle
>>>> 3) mvn pmd:pmd
>>>>
>>>> in all cases it fails due to a missing configuration xml file specific
>>>> for that tool.
>>>>
>>>> Issue 2: I cannot have it auto run when I do a Jenkins build and I
>>>> would
>>>> like to.
>>>>
>>>> Ahh! I got the analysis working on build by adding the following to
>>>> each analysis tool plugin section:
>>>>
>>>> <executions>
>>>> <execution>
>>>> <phase>verify</phase>
>>>> <goals>
>>>> <goal>check</goal>
>>>> </goals>
>>>> </execution>
>>>> </executions>
>>>>
>>>>
>>>> Unfortunately, issue 1 is still getting me. Here is the pertinent
>>>> stack
>>>> trace, below:
>>>>
>>>>
>>>> Rob
>>>>
>>>>
>>>>
>>>> [INFO]
>>>> [INFO] --- maven-checkstyle-plugin:2.9:check (default) @ murmur-events
>>>> ---
>>>>
>>>> A BUNCH OF DOWNLOAD STATEMENTS.....
>>>>
>>>> mojoFailed
>>>> org.apache.maven.plugins:maven-checkstyle-plugin:2.9(default)
>>>> [CHECKSTYLE] No report found for mojo check
>>>> [PMD] No report found for mojo check
>>>> projectFailed murmur-events:murmur-events:0.0.1-SNAPSHOT
>>>> sessionEnded
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [INFO] BUILD FAILURE
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> [INFO] Total time: 17.501s
>>>> [INFO] Finished at: Thu Oct 04 07:20:04 EDT 2012
>>>> [INFO] Final Memory: 9M/22M
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> Projects to build: [MavenProject:
>>>> murmur-events:murmur-events:0.0.1-SNAPSHOT @
>>>> C:\rob\comp\workspace\murmur-events\pom.xml]
>>>> [JENKINS] Archiving C:\rob\comp\workspace\murmur-events\pom.xml to
>>>> C:\rob\comp\builds\2012-10-04_07-19-44\archive\murmur-events\murmur-events\0.0.1-SNAPSHOT\murmur-events-0.0.1-SNAPSHOT.pom
>>>>
>>>>
>>>>
>>>>
>>>> [JENKINS] Archiving
>>>> C:\rob\comp\workspace\murmur-events\target\murmur-events-0.0.1-SNAPSHOT.jar
>>>>
>>>>
>>>>
>>>> to
>>>> C:\rob\comp\builds\2012-10-04_07-19-44\archive\murmur-events\murmur-events\0.0.1-SNAPSHOT\murmur-events-0.0.1-SNAPSHOT.jar
>>>>
>>>>
>>>>
>>>>
>>>> Waiting for Jenkins to finish collecting data
>>>> mavenExecutionResult exceptions not empty
>>>> message : Failed to execute goal
>>>> org.apache.maven.plugins:maven-checkstyle-plugin:2.9:check (default) on
>>>> project murmur-events: Failed during checkstyle execution
>>>> cause : Failed during checkstyle execution
>>>> Stack trace :
>>>> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
>>>> execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.9:check
>>>> (default) on project murmur-events: Failed during checkstyle execution
>>>> at
>>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>>>>
>>>>
>>>>
>>>>
>>>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
>>>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>>>> at
>>>> org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
>>>>
>>>>
>>>>
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>
>>>>
>>>>
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>> at
>>>> org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
>>>>
>>>>
>>>>
>>>> at
>>>> org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
>>>> at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
>>>> at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
>>>> at hudson.remoting.UserRequest.perform(UserRequest.java:118)
>>>> at hudson.remoting.UserRequest.perform(UserRequest.java:48)
>>>> at hudson.remoting.Request$2.run(Request.java:326)
>>>> at
>>>> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>
>>>>
>>>>
>>>>
>>>> at java.lang.Thread.run(Thread.java:722)
>>>> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed
>>>> during
>>>> checkstyle execution
>>>> at
>>>> org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:389)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
>>>>
>>>>
>>>>
>>>>
>>>> ... 27 more
>>>> Caused by:
>>>> org.apache.maven.plugin.checkstyle.CheckstyleExecutorException: Unable
>>>> to find configuration file at location checkstyle-configuration.xml
>>>> at
>>>> org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:556)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:246)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:169)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:380)
>>>>
>>>>
>>>>
>>>>
>>>> ... 29 more
>>>> Caused by:
>>>> org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could
>>>> not
>>>> find resource 'checkstyle-configuration.xml'.
>>>> at
>>>> org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:173)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:546)
>>>>
>>>>
>>>>
>>>>
>>>> ... 32 more
>>>> Sending e-mails to: [email protected]
>>>> efaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:169)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:380)
>>>>
>>>>
>>>>
>>>>
>>>> ... 29 more
>>>> Caused by:
>>>> org.codehaus.plexus.resource.loader.ResourceNotFoundException: Could
>>>> not
>>>> find resource 'checkstyle-configuration.xml'.
>>>> at
>>>> org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:173)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
>>>>
>>>>
>>>>
>>>>
>>>> at
>>>> org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:546)
>>>>
>>>>
>>>>
>>>>
>>>> ... 32 more
>>>> Sending e-mails to: [email protected]
>>>> channel stopped
>>>> Sending e-mails to: [email protected]
>>>> Finished: FAILURE
>>>>
>>>> -----Original Message----- From: Ulli Hafner
>>>> Sent: Thursday, October 04, 2012 7:01 AM
>>>> To: [email protected]
>>>> Subject: Re: no code analysis showing up with my builds
>>>>
>>>> Ah, now I understand:-)
>>>>
>>>> You don't need to download anything, this is maven doing for you. You
>>>> only need to add for each tool a corresponding section to your parent
>>>> pom, here is an example:
>>>> https://github.com/jenkinsci/analysis-pom-plugin/blob/master/pom.xml
>>>>
>>>> (Search for check style and findbugs)
>>>>
>>>> Then you can start Maven with mvn checkstyle:checkstyle
>>>> findbugs:findbugs
>>>>
>>>> Ulli
>>>>
>>>> Am 04.10.2012 um 12:49 schrieb Rob Withers <[email protected]>:
>>>>
>>>>> Oh? I need to invoke FindBugs, and all the other analysis tools in
>>>>> maven? :) I am brand new to maven and Jenkins, as an admin...if you
>>>>> couldn't tell...
>>>>>
>>>>> So how can I generate reports for all my analysis tools, or at least
>>>>> the following:
>>>>> 1) FindBugs
>>>>> 2) PMD
>>>>> 3) Checkstyle
>>>>>
>>>>> Ok, I downloaded these three zips and installed them, but I am at a
>>>>> loss for how to configure maven to call them. I did see I want to
>>>>> call them on the verify step. Do you have a good link or description
>>>>> on how to have maven invoke these?
>>>>>
>>>>> Thanks,
>>>>> Rob
>>>>>
>>>>>
>>>>> -----Original Message----- From: Ulli Hafner
>>>>> Sent: Thursday, October 04, 2012 2:40 AM
>>>>> To: [email protected]
>>>>> Subject: Re: no code analysis showing up with my builds
>>>>>
>>>>> Ok, then the registration is done correctly.
>>>>>
>>>>> Seems that the plug-ins don't detect that the corresponding maven goal
>>>>> is started. How do you invoke findbugs in maven? When started with
>>>>> findbugs:findbugs then everything should work out of the box…
>>>>>
>>>>> Ulli
>>>>>
>>>>>
>>>>> Am 04.10.2012 um 02:37 schrieb Rob Withers <[email protected]>:
>>>>>
>>>>>> One last thing I see. I deleted the config.xml inside the modules
>>>>>> subdirectory and copied the config.xml from the modules\murmur-events
>>>>>> direcotory to the modules subdirectory. Then I reran the build. THe
>>>>>> result did NOT have the analysis done and the config.xml in the
>>>>>> modules subdirectory, after running the build, did NOT have the
>>>>>> reporters section with the analysis tools.
>>>>>>
>>>>>> Tchuss,
>>>>>> Rob
>>>>>>
>>>>>> -----Original Message----- From: Rob Withers
>>>>>> Sent: Wednesday, October 03, 2012 7:46 PM
>>>>>> To: [email protected]
>>>>>> Subject: Re: no code analysis showing up with my builds
>>>>>>
>>>>>> Oops, I just saw that I have 2 config.xml files in my project.
>>>>>>
>>>>>> One is here: C:\software\Jenkins\jobs\murmur-events
>>>>>>
>>>>>> The other is here:
>>>>>> C:\software\Jenkins\jobs\murmur-events\modules\murmur-events$murmur-events
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> The one inside the modules directory does not have the analysis
>>>>>> reporters
>>>>>> section.
>>>>>>
>>>>>> Rob
>>>>>>
>>>>>> -----Original Message----- From: Ulli Hafner
>>>>>> Sent: Wednesday, October 03, 2012 5:51 PM
>>>>>> To: [email protected]
>>>>>> Subject: Re: no code analysis showing up with my builds
>>>>>>
>>>>>> Is there a Findbugs action in your job's config.xml file?
>>>>>>
>>>>>> Ulli
>>>>>> Am 03.10.2012 um 19:00 schrieb Rob Withers <[email protected]>:
>>>>>>
>>>>>>> There are no logs for analysis tools in the console log.
>>>>>>>
>>>>>>> Rob
>>>>>>>
>>>>>>> -----Original Message----- From: Ulli Hafner
>>>>>>> Sent: Wednesday, October 03, 2012 12:47 PM
>>>>>>> To: [email protected]
>>>>>>> Subject: Re: no code analysis showing up with my builds
>>>>>>>
>>>>>>> The analysis plug-ins log their results in the console log. Is there
>>>>>>> something printed out?
>>>>>>> E.g. [FINDBUGS] Parsing...
>>>>>>>
>>>>>>> Does your build produce the artifacts (e.g. FindBugs results XML
>>>>>>> file) that are read as input by the plugins?
>>>>>>>
>>>>>>> Ulli
>>>>>>>
>>>>>>> Am 03.10.2012 um 17:05 schrieb Rob Withers <[email protected]>:
>>>>>>>
>>>>>>>> I have the following plugins loaded:
>>>>>>>> 1) JUnit Attachments Plugin
>>>>>>>> 2) Static Analysis Utilities
>>>>>>>> 3) Static Analysis Collector Plug-in
>>>>>>>> 4) Checkstyle Plug-in
>>>>>>>> 5) PMD Plug-in
>>>>>>>> 6) FindBugs
>>>>>>>> 7) DRY
>>>>>>>>
>>>>>>>> My issue is no results are showing up when I do a build. I have
>>>>>>>> enabled the project to get these results. What gives?
>>>>>>>>
>>>>>>>> thanks,
>>>>>>>> Rob
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
<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>murmur-events</groupId>
<artifactId>murmur-events</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>murmur-events</name>
<description>A framework for model events</description>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9</version>
<configuration>
<configLocation>etc/checkstyle-configuration.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<propertyExpansion>config_loc=${project.build.directory}/</propertyExpansion>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<rulesets>
<ruleset>etc/pmd-configuration.xml</ruleset>
</rulesets>
<targetJdk>1.6</targetJdk>
<excludeRoots>
<excludeRoot>target/generated-sources/localizer</excludeRoot>
</excludeRoots>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.7.1</version>
<configuration>
<rulesets>
<ruleset>etc/pmd-configuration.xml</ruleset>
</rulesets>
<targetJdk>1.5</targetJdk>
<excludeRoots>
<excludeRoot>target/generated-sources/localizer</excludeRoot>
</excludeRoots>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.4.0</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>true</findbugsXmlOutput>
<threshold>Low</threshold>
<effort>Max</effort>
<relaxed>false</relaxed>
<fork>false</fork>
<!--excludeFilterFile>findbugs-exclusion-filter.xml</excludeFilterFile-->
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>