From f3675681c3d4422f2ad2c69d59695102eca1a7b8 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 4 Sep 2015 16:55:32 +0200 Subject: [PATCH] KEYCLOAK-1804 Replace -snapshot with startup time in resource urls --- core/src/main/java/org/keycloak/Version.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/keycloak/Version.java b/core/src/main/java/org/keycloak/Version.java index 88168437ef..2ba5b9b458 100755 --- a/core/src/main/java/org/keycloak/Version.java +++ b/core/src/main/java/org/keycloak/Version.java @@ -1,6 +1,7 @@ package org.keycloak; import org.codehaus.jackson.annotate.JsonProperty; +import org.keycloak.util.Time; import java.io.IOException; import java.io.InputStream; @@ -28,6 +29,9 @@ public class Version { VERSION = props.getProperty("version"); BUILD_TIME = props.getProperty("build-time"); RESOURCES_VERSION = VERSION.toLowerCase(); + if (RESOURCES_VERSION.endsWith("-snapshot")) { + RESOURCES_VERSION = RESOURCES_VERSION.replace("-snapshot", "-" + Time.currentTime()); + } } catch (IOException e) { VERSION=UNKNOWN; BUILD_TIME=UNKNOWN;