SonarQube Plugins
  1. SonarQube Plugins

Can't integrate SCM Activity into Jenkins with a non-Maven java build



      When we configure a non-maven build in Jenkins with SCM Activity enabled it will not work. If we set sonar.scm.enabled to false the sonar analysis will complete.
      The value of used for the scm url is the same value used in Jenkins to checkout the source.

      Here are the properties as specified in Jenkins:

      Here is the error output from Jenkins:
      Total time: 5 minutes 29 seconds
      [workspace] $ java -cp D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\sonar-runner5184753014504243199.jar;D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\sonar-batch-bootstrapper6056373472667917500.jar org.sonar.runner.Main -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://codemetrics.msidev.local:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true ******** ******** -Dsonar.projectName=MSI-GWT-LEGAL -Dsonar.projectVersion=1.0 -Dsources=trunk/source/java -Dtests=trunk/source/test -Dsonar.projectKey=msi:msi-gwt-legal -Dsonar.scm.url=scm:svn:http://msisvn.msidev.local/svn/msi/java/solutions/msi-gwt-legal/trunk -Dsonar.scm.enabled=true
      Runner configuration file: NONE
      Project configuration file: NONE
      Runner version: 1.2
      Java version: 1.6.0_18, vendor: Sun Microsystems Inc.
      OS name: "Windows Server 2008 R2", version: "6.1", arch: "amd64"
      Server: http://codemetrics.msidev.local
      Work directory: D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\.sonar
      15:47:59.667 INFO o.s.c.p.Database - Create JDBC datasource
      15:48:01.433 INFO actDatabaseConnector - Initializing Hibernate
      15:48:07.105 INFO .s.b.b.ProjectModule - ------------- Analyzing MSI-GWT-LEGAL
      15:48:07.839 INFO .s.b.ProfileProvider - Selected quality profile : [name=MSI Java Way,language=java]
      15:48:07.871 INFO nPluginsConfigurator - Configure maven plugins...
      15:48:08.074 INFO org.sonar.INFO - Compare to previous analysis (2012-04-25)
      15:48:08.105 INFO org.sonar.INFO - Compare over 5 days (2012-04-20, analysis of 2012-04-19 16:16:07.0)
      15:48:08.121 INFO org.sonar.INFO - Compare over 30 days (2012-03-26, analysis of 2012-04-16 12:59:33.0)
      15:48:08.261 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger...
      15:48:08.261 INFO jectFileSystemLogger - Source directories:
      15:48:08.261 INFO jectFileSystemLogger - D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\trunk\source\java
      15:48:08.261 INFO jectFileSystemLogger - Test directories:
      15:48:08.261 INFO jectFileSystemLogger - D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\trunk\source\test
      15:48:08.261 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger done: 0 ms
      15:48:08.558 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter...
      15:48:17.949 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter done: 9391 ms
      15:48:17.949 INFO p.PhasesTimeProfiler - Sensor SquidSensor...
      15:48:18.027 INFO .s.p.s.SquidExecutor - Java AST scan...
      15:48:24.480 INFO .s.p.s.SquidExecutor - Java AST scan done: 6453 ms
      15:48:24.590 INFO .s.p.s.SquidExecutor - Java Squid scan...
      15:48:24.590 INFO .s.p.s.SquidExecutor - Java Squid scan done: 0 ms
      15:48:24.590 INFO .s.p.s.SquidExecutor - Squid extraction...
      15:48:25.261 INFO .s.p.s.SquidExecutor - Squid extraction done: 671 ms
      15:48:25.340 INFO p.PhasesTimeProfiler - Sensor SquidSensor done: 7391 ms
      15:48:25.340 INFO p.PhasesTimeProfiler - Sensor ScmActivitySensor...
      15:48:25.340 INFO org.sonar.INFO - Check for local modifications...
      15:48:25.371 INFO .p.s.SonarScmManager - Executing: cmd.exe /X /C "svn --non-interactive --trust-server-cert status"
      15:48:25.371 INFO .p.s.SonarScmManager - Working directory: D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\trunk\source\java
      15:48:25.621 INFO .p.s.SonarScmManager - Executing: cmd.exe /X /C "svn --non-interactive --trust-server-cert status"
      15:48:25.621 INFO .p.s.SonarScmManager - Working directory: D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\trunk\source\test
      15:48:25.746 INFO org.sonar.INFO - Check for local modifications done: 406 ms
      15:48:25.840 INFO org.sonar.INFO - Retrieve changelog from revision 1...
      15:48:25.840 INFO org.sonar.INFO - It can be long this first time. Next analysis will be faster.
      15:48:25.855 INFO .p.s.SonarScmManager - Executing: cmd.exe /X /C "svn --non-interactive --trust-server-cert log -v -r 1:BASE"
      15:48:25.855 INFO .p.s.SonarScmManager - Working directory: D:\Hudson\HUDSON_HOME\jobs\MSI-GWT-LEGAL\workspace\.
      15:48:25.965 INFO org.sonar.INFO - Retrieve changelog from revision 1 done: 125 ms
      Total time: 31.563s
      Final Memory: 13M/341M
      Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: Unable to retrieve changelog: svn: '.' is not a working copy

      at org.sonar.runner.Runner.delegateExecution(
      at org.sonar.runner.Runner.execute(
      at org.sonar.runner.Main.main(
      Caused by: org.sonar.api.utils.SonarException: Unable to retrieve changelog: svn: '.' is not a working copy

      at org.sonar.plugins.scmactivity.Changelog.retrieveChangeSets(
      at org.sonar.plugins.scmactivity.Changelog.load(
      at org.sonar.plugins.scmactivity.ScmActivitySensor.analyse(
      at org.sonar.batch.phases.SensorsExecutor.execute(
      at org.sonar.batch.phases.Phases.execute(
      at org.sonar.batch.bootstrap.ProjectModule.doStart(
      at org.sonar.batch.bootstrap.Module.start(
      at org.sonar.batch.bootstrap.BatchModule.analyze(
      at org.sonar.batch.bootstrap.BatchModule.doStart(
      at org.sonar.batch.bootstrap.Module.start(
      at org.sonar.batch.bootstrap.BootstrapModule.doStart(
      at org.sonar.batch.bootstrap.Module.start(
      at org.sonar.batch.Batch.execute(
      at org.sonar.runner.Launcher.executeBatch(
      at org.sonar.runner.Launcher.execute(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.sonar.runner.Runner.delegateExecution(
      ... 2 more
      Build step 'Invoke Standalone Sonar Analysis' marked build as failure
      Finished: FAILURE

        Issue Links


          Jason Jolley added a comment -
          Jason Jolley added a comment - This seems to be linked to
          Freddy Mallet added a comment -

          Manually tested !

          Freddy Mallet added a comment - Manually tested !


            • Assignee:
              Simon Brandhof
              Jason Jolley
            • Votes:
              1 Vote for this issue
              2 Start watching this issue


              • Created: