Pārlūkot izejas kodu

SONAR-7109 remove default value of property sonar.core.serverBaseURL

tags/5.6-RC1
Sébastien Lesaint pirms 8 gadiem
vecāks
revīzija
f1994051ac

+ 0
- 1
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java Parādīt failu

@@ -61,7 +61,6 @@ public class CorePropertyDefinitions {
.name("Server base URL")
.description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.")
.category(CoreProperties.CATEGORY_GENERAL)
.defaultValue(CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE)
.build(),

PropertyDefinition.builder(CoreProperties.LINKS_HOME_PAGE)

+ 6
- 0
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java Parādīt failu

@@ -20,6 +20,7 @@
package org.sonar.api;

import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.platform.Server;

/**
* Non-exhaustive list of constants of core properties.
@@ -241,6 +242,9 @@ public interface CoreProperties {
String SERVER_STARTTIME = "sonar.core.startTime";

/**
* This property defines the SonarQubeServer base url, such as <i>http://yourhost.yourdomain/sonar</i>.
* When this property is not set, the base url of the SonarQube server is provided by {@link Server#getURL()}.
*
* @since 2.10
*/
String SERVER_BASE_URL = "sonar.core.serverBaseURL";
@@ -248,6 +252,8 @@ public interface CoreProperties {
/**
* @see #SERVER_BASE_URL
* @since 2.10
* @deprecated since 5.6. This constant default value is incorrect if a host and/or a port and/or a context have been configured.
* The correct default value when {@link #SERVER_BASE_URL} is not set is provided by {@link Server#getURL()}.
*/
String SERVER_BASE_URL_DEFAULT_VALUE = "http://localhost:9000";


+ 1
- 2
sonar-scanner-engine/src/main/java/org/sonar/batch/report/ReportPublisher.java Parādīt failu

@@ -237,8 +237,7 @@ public class ReportPublisher implements Startable {
*/
private String publicUrl() {
String baseUrl = trimToEmpty(settings.getString(CoreProperties.SERVER_BASE_URL));
if (baseUrl.equals(settings.getDefaultValue(CoreProperties.SERVER_BASE_URL))) {
// crap workaround for https://jira.sonarsource.com/browse/SONAR-7109
if (baseUrl.isEmpty()) {
// If server base URL was not configured in Sonar server then is is better to take URL configured on batch side
baseUrl = wsClient.baseUrl();
}

Notiek ielāde…
Atcelt
Saglabāt