SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-1766

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

    Details

    • Number of attachments :
      0

      Description

      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:
      sonar.projectKey=msi:msi-gwt-legal
      sonar.projectName=MSI-GWT-LEGAL
      sonar.projectVersion=1.0
      sources=trunk/source/java
      tests=trunk/source/test
      sonar.scm.url=scm:svn:http://msisvn.msidev.local/svn/msi/java/solutions/msi-gwt-legal/trunk
      sonar.scm.enabled=true

      Here is the error output from Jenkins:
      BUILD SUCCESSFUL
      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.host.url=http://codemetrics.msidev.local -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(Runner.java:189)
      at org.sonar.runner.Runner.execute(Runner.java:78)
      at org.sonar.runner.Main.main(Main.java:61)
      Caused by: org.sonar.api.utils.SonarException: Unable to retrieve changelog: svn: '.' is not a working copy

      at org.sonar.plugins.scmactivity.Changelog.retrieveChangeSets(Changelog.java:105)
      at org.sonar.plugins.scmactivity.Changelog.load(Changelog.java:55)
      at org.sonar.plugins.scmactivity.ScmActivitySensor.analyse(ScmActivitySensor.java:83)
      at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
      at org.sonar.batch.phases.Phases.execute(Phases.java:93)
      at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
      at org.sonar.batch.bootstrap.Module.start(Module.java:83)
      at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115)
      at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105)
      at org.sonar.batch.bootstrap.Module.start(Module.java:83)
      at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:109)
      at org.sonar.batch.bootstrap.Module.start(Module.java:83)
      at org.sonar.batch.Batch.execute(Batch.java:104)
      at org.sonar.runner.Launcher.executeBatch(Launcher.java:65)
      at org.sonar.runner.Launcher.execute(Launcher.java:58)
      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(Runner.java:186)
      ... 2 more
      Build step 'Invoke Standalone Sonar Analysis' marked build as failure
      Finished: FAILURE

        Issue Links

          Activity

          Hide
          Jason Jolley added a comment -
          Show
          Jason Jolley added a comment - This seems to be linked to http://jira.codehaus.org/browse/SONARPLUGINS-1122
          Hide
          Freddy Mallet added a comment -

          Manually tested !

          Show
          Freddy Mallet added a comment - Manually tested !

            People

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

              Dates

              • Created:
                Updated:
                Resolved: