SONAR newbie roadblock:
- I just installed SONAR on windows XP. Was able to configure it as a service and get the server running.
-
Then I installed sonar-runner (in a directory named
sonar-run), created asonar-project.propertiesin root, and configured it to point to my Java src project at C:\sonar-run\src. -
Tried running from my Java project src directory – C:\sonar-run\src>
..\bin\sonar-runner
First it failed with the message
Unable to resolve path '"C:sonar-runsrc"'
so I escaped the path with extra backslashes "C:\\sonar-run\\src", then I am stuck at this error:
C:\sonar-run\src>..\bin\sonar-runner
C:\sonar-run
Runner configuration file: C:\sonar-run\conf\sonar-runner.properties
Project configuration file: C:\sonar-run\src\sonar-project.properties
Runner version: 1.3
...
...
Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: Unable to resolve path '"C:\sonar-run\src"'
at org.sonar.runner.Runner.delegateExecution(Runner.java:189)
Caused by: org.sonar.api.utils.SonarException:
Unable to resolve path **'"C:\sonar-run\src"'**
What I think is the error : something to do with Unix/Windows/path/escape sequence.
Observation : earlier I was using C:\runsonar as the folder name and it was escaping \r as a special character.
CONCLUSION: Though this is a localized error I faced, these are the learnings for SONAR newbies:
- When you are sonar-runner as the client program , you need to understand SONAR was designed for *nix, so how it behaves in Windows is different and not clearly documented
- In the properties file> windows path for src > you need to escape the
\ - If you path contains a folder starting with
r. e.g\src\redthen even after escaping likesrc\\redit will becomesrc\redwhich means areturncharacter, so on for\netc.
You have to remove the double quotes in the properties file
The error message says
Unable to resolve path ‘“*C:\sonar-run\src“*’
Your entry should look like
C:\sonar-run\src