1
votes

We set up Jenkins with Sonar to generate code coverage report, and we uses Jacoco as code coverage algorithm. Jacoco is ant task to run code coverage to generate Jacoco.exec and test report, then Sonar runner is invoked in Jenkins. In addition, we installed the sonar SCM Activity Plugin, however, in sonar report, we cannot see the code coverage "on new code" section when we checked in new codes in CVS. In the sonar log, we got WARN, and the AsyncOperationEventHandler.java has new codes in CVS

02:00:56.664 WARN - Fail to retrieve SCM info of: D:.jenkins\workspace\runTestAndGenerateJacocoReport\ECMFoundation\src\com\imany\foundation\asyncoperation\AsyncOperationEventHandler.java. Reason: The cvs command failed. cvs annotate: Empty password used - try 'cvs login' with a real password

cvs [annotate aborted]: authorization failed: server maple.imany.com rejected access to /cvsroot/atg for user tom

SCM Activity plugin use empty password to login CVS, and it doesn't pick up password we set up in the file sonar-runner.properties. In sonar-runner.properties, we configured the soanr scm usr: sonar.scm.url=scm:cvs:pserver:username:[email protected]:/cvsroot/atg:ECMFoundation

And we also tried set up the scm url in sonar web management, but it didn't work as well.

Btw, In the sonar log file, we also got below scm activity log information. 01:56:09.371 INFO - Sensor ScmActivitySensor... 01:56:09.371 INFO - Trying to guess scm provider from project layout... 01:56:09.372 INFO - Didn't find which SCM provider is used. Fallback on configuration 01:56:09.373 INFO - Retrieve SCM blame information with encoding windows-1252... 01:56:09.374 WARN - SCM Activity Plugin is configured to use more threads than actually available on this machine. 01:56:13.688 INFO - Retrieve SCM blame information with encoding windows-1252 done: 4314 ms 01:56:13.689 INFO - Sensor ScmActivitySensor done: 4318 ms

2

2 Answers

0
votes

1.) Go to Sonar Web Management > Project Dashboard > Project Configuration.

2.) Find the SCM-Activity Configuration Page for your Project

3.) Configure the SCM Activity Plugin as follows:

Activation of this SCM Actitvity Plugin = true

Password = [enter your cvs-user pasword here]

SCM URL = scm:cvs:pserver:username:[email protected]:/cvsroot/atg:ECMFoundation

Thread Count = [leave empty or set to 1 if you have any difficulties]

User = [your cvs-user]

If it does not work right away, try changing the SCM URL - Parameter as described here http://maven.apache.org/scm/cvs.html

In my configuration, I use "scm:svn:svn://myserver/mysvn/mymodule" without any user or password in the URL, which seems to make sense, since I provided in the other fields.

I needed to configure my svn-repositories URL, since the automated guessing did not work, because the module-name does not match the repository-folder-name.

Please refer to the documentation for further reference

http://docs.codehaus.org/display/SONAR/SCM+Activity+Plugin

Good luck with your configuration!

0
votes

.bash_profile

set CVSROOT=:pserver:username:password@host:2401/repo
export CVSROOT

this resolve my problem

sonar job run display

...
[INFO] [16:22:33.394] Sensor ScmActivitySensor...
[INFO] [16:22:33.395] Trying to guess scm provider from project layout...
[INFO] [16:22:33.395] Didn't find which SCM provider is used. Fallback on configuration
...