Quantcast

[sonar-dev] Sonar runner batch file mistake

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Sonar runner batch file mistake

Assaf Katz

Hi,

I found out that sonar-runner.bat doesn’t support project.settings since it always add project.home that according to documentation:

·                         project.settings: specifies the path of the "sonar-project.properties" file relative to the root folder of the project to analyze. (this option is incompatible with "project.home").

 

I created a workaround for this problem in batch file itself (prefer option is handle the priority inside the JAVA) by replacing the lines:

set PROJECT_HOME=%CD%

 

%JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%"  org.sonar.runner.Main %*

 

 

 

To:

set PROJECT_HOME="-Dproject.home=%CD%"

for %%i in (%*) do (

                echo %%i | findstr /B project.settings > nul:

                if "%errorlevel%"=="0" set PROJECT_HOME=

)

 

%JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" %PROJECT_HOME% org.sonar.runner.Main %*

 

 

Do you know this problem and/or know better option?

 

BYW, I have also have problem that sonar runner ignore headless mode and display popups.

 

Thanks,

Assaf

 

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar runner batch file mistake

Freddy Mallet
Indeed you're right Assaf and this is also the case for the shell script : this project.home property is not supported at all by the two scripts.

Feel free to create a JIRA ticket.  
-----
Sonar for Continuous Inspection



On Wed, Sep 12, 2012 at 8:32 AM, Assaf Katz <[hidden email]> wrote:

Hi,

I found out that sonar-runner.bat doesn’t support project.settings since it always add project.home that according to documentation:

·                         project.settings: specifies the path of the "sonar-project.properties" file relative to the root folder of the project to analyze. (this option is incompatible with "project.home").

 

I created a workaround for this problem in batch file itself (prefer option is handle the priority inside the JAVA) by replacing the lines:

set PROJECT_HOME=%CD%

 

%JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%"  org.sonar.runner.Main %*

 

 

 

To:

set PROJECT_HOME="-Dproject.home=%CD%"

for %%i in (%*) do (

                echo %%i | findstr /B project.settings > nul:

                if "%errorlevel%"=="0" set PROJECT_HOME=

)

 

%JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar";"%SONAR_RUNNER_HOME%\lib\sonar-batch-bootstrapper.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" %PROJECT_HOME% org.sonar.runner.Main %*

 

 

Do you know this problem and/or know better option?

 

BYW, I have also have problem that sonar runner ignore headless mode and display popups.

 

Thanks,

Assaf

 

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

Loading...