diff options
-rw-r--r-- | server/sonar-docs/src/pages/setup/operate-server.md | 1 | ||||
-rw-r--r-- | sonar-application/build.gradle | 4 | ||||
-rw-r--r-- | sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat | 2 | ||||
-rw-r--r-- | sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapperTemplate.xml (renamed from sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapper.xml) | 4 |
4 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-docs/src/pages/setup/operate-server.md b/server/sonar-docs/src/pages/setup/operate-server.md index 68b50ea8f7a..9accf9d85db 100644 --- a/server/sonar-docs/src/pages/setup/operate-server.md +++ b/server/sonar-docs/src/pages/setup/operate-server.md @@ -4,7 +4,6 @@ url: /setup/operate-server/ --- ## Running SonarQube as a Service on Windows - ### Install or Uninstall SonarQube as a Service ``` diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index e2e6e4e40b7..9dcb2311151 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -140,7 +140,7 @@ task zip(type: Zip, dependsOn: [configurations.compileClasspath, tasks.downloadL } from(file('src/main/assembly')) { exclude 'conf/sonar.properties' - exclude 'bin/windows-x86-64/lib/SonarServiceWrapper.xml' + exclude 'bin/windows-x86-64/lib/SonarServiceWrapperTemplate.xml' exclude 'bin/windows-x86-64/StartSonar.bat' exclude 'elasticsearch-patch' exclude 'bin/linux-x86-64/sonar.sh' @@ -246,7 +246,7 @@ task zip(type: Zip, dependsOn: [configurations.compileClasspath, tasks.downloadL } into("${archiveDir}/bin/windows-x86-64/lib/") { - from file('src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapper.xml') + from file('src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapperTemplate.xml') filter(ReplaceTokens, tokens: [ 'sqversion': version ]) diff --git a/sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat b/sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat index 1df5e2cf027..ae7fb2672d6 100644 --- a/sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat +++ b/sonar-application/src/main/assembly/bin/windows-x86-64/SonarService.bat @@ -25,6 +25,8 @@ set REALPATH=%~dp0 rem check if Java is found set JAVA_EXE= call "%REALPATH%lib\find_java.bat" set_java_exe FAIL || goto:eof +rem replace JAVA_EXE with the Java path in configuration file +powershell -Command "(Get-Content %REALPATH%lib\SonarServiceWrapperTemplate.xml) -replace 'JAVA_EXE', '%JAVA_EXE%' | Out-File -encoding ASCII %REALPATH%lib\SonarServiceWrapper.xml" rem call the SonarServiceWrapper.exe passing all the parameters "%REALPATH%lib\SonarServiceWrapper.exe" %* diff --git a/sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapper.xml b/sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapperTemplate.xml index ec836f3c874..4393007ac00 100644 --- a/sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapper.xml +++ b/sonar-application/src/main/assembly/bin/windows-x86-64/lib/SonarServiceWrapperTemplate.xml @@ -19,8 +19,8 @@ --> <service> - <!-- Path to the Java executable --> - <executable>%JAVA_EXE%</executable> + <!-- Path to the Java executable. To be replaced by SonarService.bat script --> + <executable>JAVA_EXE</executable> <!-- DO NOT EDIT THE FOLLOWING SECTIONS --> <arguments> |