diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2022-08-19 11:57:50 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-08-25 20:03:09 +0000 |
commit | 42b991ea66289c10791b7b2e60c9e693fd58f425 (patch) | |
tree | a3582513e11f386d482803f5d8baeedc68f7520a /sonar-application | |
parent | 1e297c135a922f1a1049ed9ff5169f25e19658d8 (diff) | |
download | sonarqube-42b991ea66289c10791b7b2e60c9e693fd58f425.tar.gz sonarqube-42b991ea66289c10791b7b2e60c9e693fd58f425.zip |
SONAR-17224 Fix WinSW not reading environment variable
Diffstat (limited to 'sonar-application')
-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 |
3 files changed, 6 insertions, 4 deletions
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> |