Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

sonar-runner.bat 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. @REM Sonar Runner Startup Script for Windows
  2. @REM
  3. @REM Required ENV vars:
  4. @REM JAVA_HOME - location of a JDK home dir
  5. @REM
  6. @REM Optional ENV vars:
  7. @REM SONAR_RUNNER_HOME - location of runner's installed home dir
  8. @REM SONAR_RUNNER_OPTS - parameters passed to the Java VM when running Sonar
  9. @echo off
  10. @REM ==== START VALIDATION ====
  11. @REM *** JAVA EXEC VALIDATION ***
  12. if not "%JAVA_HOME%" == "" goto foundJavaHome
  13. for %%i in (java.exe) do set JAVA_EXEC=%%~$PATH:i
  14. if not "%JAVA_EXEC%" == "" (
  15. set JAVA_EXEC="%JAVA_EXEC%"
  16. goto OkJava
  17. )
  18. if not "%JAVA_EXEC%" == "" goto OkJava
  19. echo.
  20. echo ERROR: JAVA_HOME not found in your environment, and no Java
  21. echo executable present in the PATH.
  22. echo Please set the JAVA_HOME variable in your environment to match the
  23. echo location of your Java installation, or add "java.exe" to the PATH
  24. echo.
  25. goto end
  26. :foundJavaHome
  27. if EXIST "%JAVA_HOME%\bin\java.exe" goto foundJavaExeFromJavaHome
  28. echo.
  29. echo ERROR: JAVA_HOME exists but does not point to a valid Java home
  30. echo folder. No "\bin\java.exe" file can be found there.
  31. echo.
  32. goto end
  33. :foundJavaExeFromJavaHome
  34. set JAVA_EXEC="%JAVA_HOME%\bin\java.exe"
  35. @REM *** SONAR RUNNER HOME VALIDATION ***
  36. :OkJava
  37. if NOT "%SONAR_RUNNER_HOME%"=="" goto cleanSonarRunnerHome
  38. set SONAR_RUNNER_HOME=%~dp0..
  39. goto run
  40. :cleanSonarRunnerHome
  41. @REM If the property has a trailing backslash, remove it
  42. if %SONAR_RUNNER_HOME:~-1%==\ set SONAR_RUNNER_HOME=%SONAR_RUNNER_HOME:~0,-1%
  43. @REM Check if the provided SONAR_RUNNER_HOME is a valid install dir
  44. IF EXIST "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar" goto run
  45. echo.
  46. echo ERROR: SONAR_RUNNER_HOME exists but does not point to a valid install
  47. echo directory: %SONAR_RUNNER_HOME%
  48. echo.
  49. goto end
  50. @REM ==== START RUN ====
  51. :run
  52. echo %SONAR_RUNNER_HOME%
  53. set PROJECT_HOME=%CD%
  54. %JAVA_EXEC% %SONAR_RUNNER_OPTS% -classpath "%SONAR_RUNNER_HOME%\lib\sonar-runner.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.internal.Main %*
  55. @REM ==== END EXECUTION ====
  56. :end