sonar-runner.bat Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher .java:91) - sonarqube

I got the latest sonar-runner-dist-2.4 and sonarqube-4.3. Server starts fine, i can see the localhost But when i try to run the sonar-runner.bat -X, i see the below error. I looked at versions, logs but couldn't find the root-cause. Any help will be appreciated.
enter code here
MyProject>sonar-runner.bat -X
C:\sonar\sonar-runner-dist-2.4
SonarQube Runner 2.4
Java 1.6.0 IBM Corporation (32-bit)
Windows Vista 6.1 build 7601 Service Pack 1 x86
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\sonar\sonar-runner-dist-2.4\conf\sonar-runne
r.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is
platform dependent)
INFO: Work directory: C:\cww\application\CWW_FSET_R0\online\aeEJB\.\.sonar
INFO: SonarQube Server 4.3
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.191s
Final Memory: 2M/5M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(AccessController.java:202
)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102
)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.TypeNotPresentException: Type javax.annotation.CheckForNull
not present
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.j
ava:38)
at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(Annotatio
nHelper.java:50)
at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:31)
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:687)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.ja
va:186)
at com.ibm.oti.reflect.Method.getAnnotation(Method.java:20)
at java.lang.reflect.Method.getAnnotation(Method.java:677)
at org.picocontainer.injectors.AdaptingInjection.injectionAnnotated(Adap
tingInjection.java:230)
at org.picocontainer.injectors.AdaptingInjection.access$000(AdaptingInje
ction.java:46)
at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection
.java:203)
at java.security.AccessController.doPrivileged(AccessController.java:202
)
at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotate
d(AdaptingInjection.java:200)
at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectio
nAdapter(AdaptingInjection.java:171)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(
AdaptingInjection.java:70)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAd
apter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptIn
Caching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContai
ner.java:535)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContaine
r.java:83)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addC
omponent(DefaultPicoContainer.java:1148)
at org.sonar.api.platform.ComponentContainer.addComponent(ComponentConta
iner.java:175)
at org.sonar.api.platform.ComponentContainer.addSingleton(ComponentConta
iner.java:163)
at org.sonar.api.platform.ComponentContainer.add(ComponentContainer.java
:149)
at org.sonar.batch.bootstrap.BootstrapContainer.addBootstrapComponents(B
ootstrapContainer.java:83)
at org.sonar.batch.bootstrap.BootstrapContainer.doBeforeStart(BootstrapC
ontainer.java:77)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:90)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.
java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java
:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
.java:87)
... 9 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.CheckForNull
at java.lang.Class.forName(Class.java:169)
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.j
ava:33)
... 42 more
Here is my property file :
# required metadata
sonar.projectKey=my:MyProject
sonar.projectName=MyProject
sonar.projectVersion=1.0
# optional description
sonar.projectDescription=Any description
# path to source directories (required)
sonar.sources=src
# path to test source directories (optional)
#sonar.tests=testDir1,testDir2
# path to project binaries (optional), for example directory of Java bytecode
sonar.binaries=bin
# The value of the property must be the key of the language.
sonar.language=java
# Additional parameters
sonar.my.property=value

This issue seems to relate to the use of the IBM Java Virtual Machine : http://www-01.ibm.com/support/docview.wss?uid=swg1IZ76354. By using the Oracle one this should fix your issue.

Related

Error during SonarQube Scanner execution with sonar python enabled

I am a very new sonarqube user, experimenting with my python project.
I have installed docker Sonarqube image which has Sonarpython plugin installed. I installed the linux base sonar scanner.
Using these instructions, I configured the scanner.
However when running it, I run into:
11:28:33.486 INFO: Configured Java source version (sonar.java.source): none
11:28:33.496 INFO: JavaClasspath initialization
11:28:33.512 INFO: ------------------------------------------------------------------------
11:28:33.512 INFO: EXECUTION FAILURE
11:28:33.512 INFO: ------------------------------------------------------------------------
11:28:33.513 INFO: Total time: 22.237s
11:28:33.670 INFO: Final Memory: 28M/509M
11:28:33.671 INFO: ------------------------------------------------------------------------
11:28:33.671 ERROR: Error during SonarQube Scanner execution
org.sonar.java.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property
at org.sonar.java.JavaClasspath.init(JavaClasspath.java:66)
at org.sonar.java.AbstractJavaClasspath.getElements(AbstractJavaClasspath.java:280)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:175)
at org.sonar.java.JavaSquid.<init>(JavaSquid.java:82)
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:91)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:359)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:354)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:317)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Do I need to configure sonar.java.source to successfully scan?
As soon as you are having some Java sources in your project, SonarQube is going to ask you for the compiled binaries as well in order to perform the analysis. It let you with 2 choices:
If you want to focus on Python code only, then ignore java code by properly excluding it with the following scanner property: sonar.exclusions=**/*.java. For more information regarding exclusions, you can have a look at this page: SonarQube 7.7 - Narrowing the focus. Another way could be to only include python files, which would ignore all the other one. We however recommend to have the broader analysis possible.
If you want to also analyse your Java code, then build your project first, and provide the path to your binaries and libraries (optional) using the following properties: sonar.java.binaries and sonar.java.libraries. Refer to this documentation page for configuration: Java Plugin and Bytecode

Sonarqube scanner error DirectoryNotEmptyException

I am using sonarqube scanner on a Citrix remote machine. During the scan, analysis of code completes and gets zipped. But while uploading this zipped file, I get java.nio.file.DirectoryNotEmptyException and nothing gets uploaded to the sonarqube server.
Note that the scanner works fine for small projects. It does not work only for large projects. My sonarqube version is 7.2.1. Same thing happened in version 6.7 LTS. But it worked perfectly fine in version 5.6 LTS.
I have tried setting sonar.ws.timeout=9000 in sonar-scanner.properties file to increase time. This did not work.
The error message is:
INFO: 7 files had no CPD blocks
INFO: Calculating CPD for 521 files
INFO: CPD calculation finished
INFO: Analysis report generated in 4886ms, dir size=15 MB
INFO: Analysis reports compressed in 3769ms, zip size=4 MB
ERROR: Failed to delete temp folder
java.nio.file.DirectoryNotEmptyException: C:\codeAnalyzer\bhatk\.scannerwork\.sonartmp
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProv
ider.java:266)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSyst
emProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileV
isitor.postVisitDirectory(DefaultTempFolder.java:121)
at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileV
isitor.postVisitDirectory(DefaultTempFolder.java:110)
at java.nio.file.Files.walkFileTree(Files.java:2688)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at org.sonar.api.utils.internal.DefaultTempFolder.clean(DefaultTempFolde
r.java:97)
at org.sonar.api.utils.internal.DefaultTempFolder.stop(DefaultTempFolder
.java:106)
at org.sonar.scanner.analysis.AnalysisTempFolderProvider.stop(AnalysisTe
mpFolderProvider.java:61)
at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContai
ner.java:1048)
at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java
:803)
at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentCo
ntainer.java:165)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer
.java:124)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:
81)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC
ontainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer
.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContain
er.java:132)
at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.exec
ute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(Iso
latedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner
.java:171)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.j
ava:128)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3:27.575s
INFO: Final Memory: 60M/2882M
INFO: -----------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Fail to request http://localhost:9000/api/ce/submit?projectKey=my:project
&projectName=My%20project
ERROR: Caused by: timeout
ERROR: Caused by: Socket closed
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging
.
the error caused by default 10s writeTimeout inherited from OkHttp library. While readTimeout is configurable by sonar.ws.timeout param, the writeTimout is not currently configurable. In some cases, depends on the analysis report size and /or your infrastructure setup, 10s is not enough to upload an analysis report that causes socket timeout error and DirectoryNotEmptyException. I have implemented a fix and committed it to SonarSource github: https://github.com/SonarSource/sonarqube/pull/3252/files

Getting error while run sonar-scanner: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level

sonar-scanner -X
19:49:25.192 INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/3.1.0.1141/libexec/conf/sonar-scanner.properties
19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141
19:49:25.212 INFO: Java 1.8.0_131 Oracle Corporation (64-bit)
19:49:25.212 INFO: Mac OS X 10.13 x86_64
19:49:25.363 DEBUG: keyStore is :
19:49:25.363 DEBUG: keyStore type is : jks
19:49:25.363 DEBUG: keyStore provider is :
19:49:25.589 DEBUG: Create isolated classloader...
19:49:25.597 DEBUG: Start temp cleaning...
19:49:25.607 DEBUG: Temp cleaning done
19:49:25.607 DEBUG: Execution getVersion
List item
19:49:25.623 INFO: EXECUTION FAILURE
19:49:25.623 INFO: ------------------------------------------------------------------------
19:49:25.623 INFO: Total time: 0.452s
19:49:25.648 INFO: Final Memory: 4M/123M
19:49:25.648 INFO: ------------------------------------------------------------------------
19:49:25.648 ERROR: Error during SonarQube Scanner execution
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level
at org.sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(DefaultBatchFactory.java:35)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level
... 13 more
Caused by: java.lang.ClassNotFoundException: org.sonar.batch.bootstrapper.LogOutput$Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
SonarQube Scanner 3.1.0.1141 (19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141) is compatible with SonarQube 5.6+ (LTS) (read more here). You have SonarQube server 5.0.1 (19:49:25.610 INFO: SonarQube server 5.0.1) so those two tools are incompatible (class org/sonar/batch/bootstrapper/LogOutput$Level has been added in 5.2).
You can:
use an older version of the scanner (download sonar-runner 2.4 - read about runner vs scanner)
upgrade SonarQube server to at least 5.6

Status returned by url [http://localhost:9000/batch_bootstrap/index] is not valid

When I am trying to run sonar-scanner, I was not able to start sonarqube and this error is being displayed.
INFO: Scanner configuration file: /sonar-scanner-2.8/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Mac OS X 10.12.1 x86_64
INFO: User cache: /.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.417s
INFO: Final Memory: 3M/123M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)
at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
... 8 more
Caused by: java.lang.IllegalStateException: Status returned by url [http://localhost:9000/batch_bootstrap/index] is not valid: [404]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:78)
... 11 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Actually, you should first start SonarQube. When it runs, then you can start your scanner.
I get the case where my port 9001 was already in used and SonarQube server did't start. To resolve it, I changed the port to 19001 (free on my computer) in SonarQube_Dir/conf/sonar.properties
sonar.search.port=19001
After this change, I was able to start the sonarQube server, and run the scanner.

Debugging Sonar Qube plugin

Following the guide at http://docs.sonarqube.org/display/DEV/Debugging, I have encounter an issue where the sonar-runner appears to be looking in the wrong place for the sonar-project.properties file.
This happens when I try to debug with Intellij.
Can anyone help?
Thanks
Matt
I get the following error:
SONAR_RUNNER_OPTS=-Xdebug -Xnoagent -Duser.dir=c:\dev\eci -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
INFO: Error stacktraces are turned on.
ERROR: homekey=runner.home
ERROR: homrelativePathFromHom=conf/sonar-runner.properties
ERROR: settingsKey=runner.settings
INFO: Runner configuration file: C:\Sonar\sonar-runner-2.4\conf\sonar- runner.properties
ERROR: homekey=project.home
ERROR: homrelativePathFromHom=sonar-project.properties
ERROR: settingsKey=project.settings
INFO: Project configuration file: NONE
INFO: Default locale: "en_AU", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: c:\dev\eci\.\.sonar
INFO: SonarQube Server 5.1.1
17:30:39.333 INFO - Load global repositories
17:30:39.340 DEBUG - Download: http://localhost:9000/batch/global (no proxy)
17:30:39.490 INFO - Load global repositories (done) | time=159ms
17:30:39.492 INFO - Server id: 20150731104939
17:30:39.493 INFO - User cache: C:\Users\matthewo\.sonar\cache
17:30:39.499 INFO - Install plugins
17:30:39.499 DEBUG - Download index of plugins
17:30:39.499 DEBUG - Download: http://localhost:9000/deploy/plugins/index.txt (no proxy)
17:30:39.585 DEBUG - Loaded 2138 properties from l10n bundles
17:30:39.585 INFO - Install JDBC driver
17:30:39.585 DEBUG - Download index of jdbc-driver
17:30:39.585 DEBUG - Download: http://localhost:9000/deploy/jdbc-driver.txt (no proxy)
17:30:39.592 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://localhost:1433/Sonar;instance=MSSQL2012;SelectMethod=Curso r
17:31:03.765 DEBUG - Testing JDBC connection
17:31:04.351 DEBUG - Download: http://localhost:9000/api/server (no proxy)
17:31:04.368 INFO - Initializing Hibernate
17:31:04.370 DEBUG - hibernate.generate_statistics: false
17:31:04.370 DEBUG - hibernate.dialect: org.sonar.core.persistence.dialect.MsSql$MsSqlDialect
17:31:04.370 DEBUG - hibernate.connection.provider_class: org.sonar.jpa.session.CustomHibernateConnectionProvider
INFO: ---------------------------------------------------------------------- --
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 26.253s
Final Memory: 66M/340M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
at org.sonar.batch.scan.ProjectReactorBuilder.checkMandatoryProperties(ProjectReact orBuilder.java:315)
at org.sonar.batch.scan.ProjectReactorBuilder.defineRootProject(ProjectReactorBuild er.java:157)
at org.sonar.batch.scan.ProjectReactorBuilder.execute(ProjectReactorBuilder.java:116)
at org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:110)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:86)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:90)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
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.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
Is there any way to set the working directory, so sonar-runner finds the project properties in the correct location - where I am executing the command from?
Thanks
Matt
Why are you trying to update the user directory? Try to remove -Duser.dir=c:\dev\eci from SONAR_RUNNER_OPTS

Resources