Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9.1
-
Component/s: None
-
Labels:None
-
Number of attachments :0
Description
We are currently using version 2.3.2. What would be great it to be able to define the version to use in the Settings service.
Issue Links
| This issue is related to: | ||||
| SONAR-724 | cannot execute clover2:instrument 'target/sonar/pom.xml' does not exist |
|
|
|
Activity
It would be awesome to fix this, right now we're sort of stuck, because we have defined in our parent Maven pom to use Clover 2.4.3, and the site generation works well, but attempting to use sonar after the site generation doesn't work.
and weirdly, I can't even just use sonar, if I have a multi-module setup, and run this :
clean install sonar:sonar
I get this error when running through Bamboo:
.... 13-May-2009 20:30:15 [INFO] Clover Version 2.3.2, built on July 15 2008 (build-732) 13-May-2009 20:30:15 [INFO] Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar 13-May-2009 20:30:15 [INFO] Clover: Commercial License registered to Ac0nex. 13-May-2009 20:30:15 [INFO] Loading coverage database from: '/vol0/aconex/bamboo/config/xml-data/build-dir/INSTALLER-MVN/installer-manifest/target/clover/clover.db' 13-May-2009 20:30:15 [WARNING] No coverage recordings found. No report will be generated. 13-May-2009 20:30:15 [INFO] ------------------------------------------------------------------------ 13-May-2009 20:30:15 [ERROR] BUILD ERROR 13-May-2009 20:30:15 [INFO] ------------------------------------------------------------------------ 13-May-2009 20:30:15 [INFO] Can not execute Sonar 13-May-2009 20:30:15 13-May-2009 20:30:15 Embedded error: Unable to execute mojo 13-May-2009 20:30:15 1 annotations had invalid placement pages. ...
I suspect because without site, or without explicitly running clover2:instrument et al, sonar can't find any clover metrics.
Please help!
We love Sonar!
.... 13-May-2009 20:30:15 [INFO] Clover Version 2.3.2, built on July 15 2008 (build-732) 13-May-2009 20:30:15 [INFO] Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar 13-May-2009 20:30:15 [INFO] Clover: Commercial License registered to Ac0nex. 13-May-2009 20:30:15 [INFO] Loading coverage database from: '/vol0/aconex/bamboo/config/xml-data/build-dir/INSTALLER-MVN/installer-manifest/target/clover/clover.db' 13-May-2009 20:30:15 [WARNING] No coverage recordings found. No report will be generated. 13-May-2009 20:30:15 [INFO] ------------------------------------------------------------------------ 13-May-2009 20:30:15 [ERROR] BUILD ERROR 13-May-2009 20:30:15 [INFO] ------------------------------------------------------------------------ 13-May-2009 20:30:15 [INFO] Can not execute Sonar 13-May-2009 20:30:15 13-May-2009 20:30:15 Embedded error: Unable to execute mojo 13-May-2009 20:30:15 1 annotations had invalid placement pages. ...
If anyone else hits this, I managed to get this to work if I do this:
mvn clean package com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:instrument com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:aggregate com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:clover sonar:sonar
this eliminates the site phase entirely (which is fine by me, I don't need the HTML, just the quality data)
obviously though, it's a bit... verbose.. :-D
mvn clean package com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:instrument com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:aggregate com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:clover sonar:sonar
Paul, I've seen your SOS message
. We'll do our best to fix this ticket in Sonar 1.10.
on last follow up in case google trawling and keyword searches point people this way, the evil line above in my bamboo output:
13-May-2009 20:30:15 [INFO] Can not execute Sonar 13-May-2009 20:30:15 13-May-2009 20:30:15 Embedded error: Unable to execute mojo 13-May-2009 20:30:15 1 annotations had invalid placement pages.
can still happen with sonar+clover:2.3.2. Our clover report definition specified all 3 reports (PDF, XML, HTML), it's dieing on the PDF, so turning that one off (we didn't need PDF, and in fact I wasn't sure why it was on) makes this go away.
Still.. Upgrade Clover would be nice at the very least.
Don't forget that Clover 2.5 is out now too... ![]()
13-May-2009 20:30:15 [INFO] Can not execute Sonar 13-May-2009 20:30:15 13-May-2009 20:30:15 Embedded error: Unable to execute mojo 13-May-2009 20:30:15 1 annotations had invalid placement pages.
I'm not sure to understand. Clover version is not fixed in Sonar. It should reuse the version found in pom, else 2.3.2.
As the Sonar docs and Simon mention, Sonar is suppose to use the Clover plugin version that's in the POM. This however,
doesn't seem to be the case for me. Below you can find my effective POM:
root@mshbamboo:/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL# mvn help:effective-pom
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[INFO] Building UPMA Model Project
[INFO] task-segment: [help:effective-pom] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:effective-pom]
[INFO]
Effective POMs, after inheritance, interpolation, and profiles are applied:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 5/27/09 9:41 AM -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'com.sinai.upma:upma-model:jar:0.0.1-SNAPSHOT' -->
<!-- -->
<!-- ====================================================================== -->
<project xmlns="http://maven.apache.org/POM/4.0.0" ...">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>upma-parent</artifactId>
<groupId>com.sinai.upma</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.sinai.upma</groupId>
<artifactId>upma-model</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>UPMA Model Project</name>
<description>The Maven module that contains the models for the UPMA
project.</description>
<build>
...
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<targetPercentage>90%</targetPercentage>
<license>....</license>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<targetPercentage>50%</targetPercentage>
<license>...</license>
</configuration>
</plugin>
...
</dependency>
<dependency>
<groupId>com.cenqua.clover</groupId>
<artifactId>clover</artifactId>
<version>2.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
...
</project>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed May 27 09:41:11 EDT 2009
[INFO] Final Memory: 6M/13M
[INFO] ------------------------------------------------------------------------
However, when I run the sonar:sonar goal, Sonar fails and this probably has to do with using an older plugin, version 2.3.2.
We really need for the 2.5.0 plugin to be used because TestNG Provider coverage was only added then. Is there a way to manually
change the plugin version to 2.5.0?
Below is the full trace of running sonar:sonar.
root@mshbamboo:/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL# mvn sonar:sonar [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'sonar'. [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [sonar:sonar] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] [sonar:sonar] [INFO] Sonar host: http://localhost:9000 [INFO] Sonar version: 1.9 [INFO] [sonar-core:internal] [INFO] Sonar JDBC URL: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 [INFO] Sonar JDBC login: sonar [INFO] Sonar JDBC driver: com.mysql.jdbc.Driver [INFO] Sonar branch: [INFO] UPMA Model Project Selected quality profile : Sonar way, language=java [INFO] UPMA Model Project Executing org.apache.maven.plugins:maven-checkstyle-plugin:[checkstyle] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [org.apache.maven.plugins:maven-checkstyle-plugin:2.2:checkstyle] [INFO] ------------------------------------------------------------------------ [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] ************************************************************** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) [INFO] Default ResourceManager initialization complete. [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach [INFO] Created: 20 parsers. [INFO] Velocimacro : initialization starting. [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' [INFO] Velocimacro : VM library template macro registration complete. [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. [INFO] Velocimacro : initialization complete. [INFO] Velocity successfully started. [INFO] [checkstyle:checkstyle] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] There are 1 checkstyle errors. [INFO] UPMA Model Project Executing org.apache.maven.plugins:maven-pmd-plugin:[pmd] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [org.apache.maven.plugins:maven-pmd-plugin:2.4:pmd] [INFO] ------------------------------------------------------------------------ [INFO] [pmd:pmd] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] UPMA Model Project Executing com.atlassian.maven.plugins:maven-clover2-plugin:[instrument, clover] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:instrument] [INFO] ------------------------------------------------------------------------ [INFO] Preparing clover2:instrument [INFO] [clover2:instrumentInternal] Clover Version 2.3.2, built on July 15 2008 (build-732) Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar Clover: Community License registered to Mount Sinai Hospital. Creating new database at '/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/clover.db'. Processing files at 1.5 source level. Clover all over. Instrumented 2 files (1 package). Clover Version 2.3.2, built on July 15 2008 (build-732) Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar Clover: Community License registered to Mount Sinai Hospital. Updating existing database at '/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/clover.db'. Processing files at 1.5 source level. Clover all over. Instrumented 1 file (1 package). [INFO] [resources:resources] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [compiler:compile] [INFO] Compiling 2 source files to /usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: Unable to execute mojo Compilation failure [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9 seconds [INFO] Finished at: Wed May 27 09:43:55 EDT 2009 [INFO] Final Memory: 28M/50M [INFO] ------------------------------------------------------------------------
Best regards,
Arthur Kalmenson
root@mshbamboo:/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL# mvn help:effective-pom
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[INFO] Building UPMA Model Project
[INFO] task-segment: [help:effective-pom] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:effective-pom]
[INFO]
Effective POMs, after inheritance, interpolation, and profiles are applied:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 5/27/09 9:41 AM -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'com.sinai.upma:upma-model:jar:0.0.1-SNAPSHOT' -->
<!-- -->
<!-- ====================================================================== -->
<project xmlns="http://maven.apache.org/POM/4.0.0" ...">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>upma-parent</artifactId>
<groupId>com.sinai.upma</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.sinai.upma</groupId>
<artifactId>upma-model</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>UPMA Model Project</name>
<description>The Maven module that contains the models for the UPMA
project.</description>
<build>
...
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<targetPercentage>90%</targetPercentage>
<license>....</license>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<targetPercentage>50%</targetPercentage>
<license>...</license>
</configuration>
</plugin>
...
</dependency>
<dependency>
<groupId>com.cenqua.clover</groupId>
<artifactId>clover</artifactId>
<version>2.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
...
</project>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed May 27 09:41:11 EDT 2009
[INFO] Final Memory: 6M/13M
[INFO] ------------------------------------------------------------------------
root@mshbamboo:/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL# mvn sonar:sonar [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'sonar'. [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [sonar:sonar] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] [sonar:sonar] [INFO] Sonar host: http://localhost:9000 [INFO] Sonar version: 1.9 [INFO] [sonar-core:internal] [INFO] Sonar JDBC URL: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 [INFO] Sonar JDBC login: sonar [INFO] Sonar JDBC driver: com.mysql.jdbc.Driver [INFO] Sonar branch: [INFO] UPMA Model Project Selected quality profile : Sonar way, language=java [INFO] UPMA Model Project Executing org.apache.maven.plugins:maven-checkstyle-plugin:[checkstyle] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [org.apache.maven.plugins:maven-checkstyle-plugin:2.2:checkstyle] [INFO] ------------------------------------------------------------------------ [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] ************************************************************** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) [INFO] Default ResourceManager initialization complete. [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach [INFO] Created: 20 parsers. [INFO] Velocimacro : initialization starting. [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' [INFO] Velocimacro : VM library template macro registration complete. [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. [INFO] Velocimacro : initialization complete. [INFO] Velocity successfully started. [INFO] [checkstyle:checkstyle] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] There are 1 checkstyle errors. [INFO] UPMA Model Project Executing org.apache.maven.plugins:maven-pmd-plugin:[pmd] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [org.apache.maven.plugins:maven-pmd-plugin:2.4:pmd] [INFO] ------------------------------------------------------------------------ [INFO] [pmd:pmd] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] UPMA Model Project Executing com.atlassian.maven.plugins:maven-clover2-plugin:[instrument, clover] [INFO] ------------------------------------------------------------------------ [INFO] Building UPMA Model Project [INFO] task-segment: [com.atlassian.maven.plugins:maven-clover2-plugin:2.3.2:instrument] [INFO] ------------------------------------------------------------------------ [INFO] Preparing clover2:instrument [INFO] [clover2:instrumentInternal] Clover Version 2.3.2, built on July 15 2008 (build-732) Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar Clover: Community License registered to Mount Sinai Hospital. Creating new database at '/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/clover.db'. Processing files at 1.5 source level. Clover all over. Instrumented 2 files (1 package). Clover Version 2.3.2, built on July 15 2008 (build-732) Loaded from: /root/.m2/repository/com/cenqua/clover/clover/2.3.2/clover-2.3.2.jar Clover: Community License registered to Mount Sinai Hospital. Updating existing database at '/usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/clover.db'. Processing files at 1.5 source level. Clover all over. Instrumented 1 file (1 package). [INFO] [resources:resources] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 0 resource [INFO] [compiler:compile] [INFO] Compiling 2 source files to /usr/local/bamboo-home/xml-data/build-dir/UPMA-MODEL/target/clover/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: Unable to execute mojo Compilation failure [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9 seconds [INFO] Finished at: Wed May 27 09:43:55 EDT 2009 [INFO] Final Memory: 28M/50M [INFO] ------------------------------------------------------------------------
Simon, if you take a look to the Clover2MavenPluginHandler, you'll see that version 2.3.2 is hard coded. Shouldn't be difficult to fix this.
Plugin versions defined in pom are not correctly used, so plugins always execute with the default versions registered in sonar (clover 2.3.1 for example). It's fixed now, see SONAR-878.
Clover is still upgraded to 2.5.1 by default.
Maybe it would be nice if the Sonar plugin could detect the Clover plugin version defined in the pom of the project Sonar is running for and default back to a specific version if the project is not configured with a specific version for Clover