From 5394a58739dd14d397ae5594cb92b408b29ccc58 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Mon, 21 Oct 2019 16:53:08 +0200 Subject: [PATCH] SONAR-12395 Update to sonar-update-center 1.23, handle new download URLs --- build.gradle | 2 +- .../org/sonar/server/platform/ws/UpgradesAction.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b9bfd5617e7..ac095b7bbc7 100644 --- a/build.gradle +++ b/build.gradle @@ -280,7 +280,7 @@ subprojects { dependency 'org.reflections:reflections:0.9.9' dependency 'org.simpleframework:simple:4.1.21' dependency 'org.sonarsource.orchestrator:sonar-orchestrator:3.27.0.2172' - dependency 'org.sonarsource.update-center:sonar-update-center-common:1.18.0.487' + dependency 'org.sonarsource.update-center:sonar-update-center-common:1.23.0.723' dependency 'org.subethamail:subethasmtp:3.1.7' dependency 'org.yaml:snakeyaml:1.17' dependency 'xml-apis:xml-apis:1.4.01' diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/UpgradesAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/UpgradesAction.java index a6fd5f95ec6..5e1232deea1 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/UpgradesAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/UpgradesAction.java @@ -49,7 +49,10 @@ public class UpgradesAction implements SystemWsAction { private static final String PROPERTY_DESCRIPTION = "description"; private static final String PROPERTY_RELEASE_DATE = "releaseDate"; private static final String PROPERTY_CHANGE_LOG_URL = "changeLogUrl"; - private static final String PROPERTY_DOWNLOAD_URL = "downloadUrl"; + private static final String PROPERTY_COMMUNITY_DOWNLOAD_URL = "downloadUrl"; + private static final String PROPERTY_DEVELOPER_DOWNLOAD_URL = "downloadDeveloperUrl"; + private static final String PROPERTY_ENTERPRISE_DOWNLOAD_URL = "downloadEnterpriseUrl"; + private static final String PROPERTY_DATACENTER_DOWNLOAD_URL = "downloadDatacenterUrl"; private static final String OBJECT_PLUGINS = "plugins"; private static final String ARRAY_REQUIRE_UPDATE = "requireUpdate"; private static final String ARRAY_INCOMPATIBLE = "incompatible"; @@ -65,7 +68,10 @@ public class UpgradesAction implements SystemWsAction { jsonWriter.prop(PROPERTY_DESCRIPTION, release.getDescription()); jsonWriter.propDate(PROPERTY_RELEASE_DATE, release.getDate()); jsonWriter.prop(PROPERTY_CHANGE_LOG_URL, release.getChangelogUrl()); - jsonWriter.prop(PROPERTY_DOWNLOAD_URL, release.getDownloadUrl()); + jsonWriter.prop(PROPERTY_COMMUNITY_DOWNLOAD_URL, release.getDownloadUrl(Release.Edition.COMMUNITY)); + jsonWriter.prop(PROPERTY_DEVELOPER_DOWNLOAD_URL, release.getDownloadUrl(Release.Edition.DEVELOPER)); + jsonWriter.prop(PROPERTY_ENTERPRISE_DOWNLOAD_URL, release.getDownloadUrl(Release.Edition.ENTERPRISE)); + jsonWriter.prop(PROPERTY_DATACENTER_DOWNLOAD_URL, release.getDownloadUrl(Release.Edition.DATACENTER)); } @Override -- 2.39.5