mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-08 14:32:05 -03:30
Enable branding without code changes (#34246)
closes #34244 Signed-off-by: Peter Skopek <pskopek@redhat.com>
This commit is contained in:
parent
c05b84a0d2
commit
14e4e1aed2
@ -27,27 +27,33 @@ import java.util.Properties;
|
||||
*/
|
||||
public class Version {
|
||||
public static final String UNKNOWN = "UNKNOWN";
|
||||
public static final String NAME = "Keycloak";
|
||||
public static final String NAME_HTML = "<div class=\"kc-logo-text\"><span>Keycloak</span></div>";
|
||||
public static String VERSION;
|
||||
public static String RESOURCES_VERSION;
|
||||
public static String BUILD_TIME;
|
||||
|
||||
private static String name;
|
||||
|
||||
static {
|
||||
try (InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties")) {
|
||||
Properties props = new Properties();
|
||||
props.load(is);
|
||||
Version.VERSION = props.getProperty("version");
|
||||
Version.BUILD_TIME = props.getProperty("build-time");
|
||||
name = props.getProperty("name");
|
||||
Version.RESOURCES_VERSION = Version.VERSION.toLowerCase();
|
||||
|
||||
if (Version.RESOURCES_VERSION.endsWith("-snapshot")) {
|
||||
Version.RESOURCES_VERSION = Version.RESOURCES_VERSION.replace("-snapshot", "-" + Version.BUILD_TIME.replace(" ", "").replace(":", "").replace("-", ""));
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
Version.VERSION = Version.UNKNOWN;
|
||||
Version.BUILD_TIME = Version.UNKNOWN;
|
||||
name = "Keycloak";
|
||||
}
|
||||
}
|
||||
|
||||
public static final String NAME = name;
|
||||
public static final String NAME_HTML = "<div class=\"kc-logo-text\"><span>" + name + "</span></div>";
|
||||
|
||||
}
|
||||
|
||||
@ -15,4 +15,5 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
version=${project.version}
|
||||
build-time=${project.build-time}
|
||||
build-time=${project.build-time}
|
||||
name=${project.build-name}
|
||||
@ -82,6 +82,17 @@
|
||||
<module>downloads</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dist-api-docs</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>dist.api.docs</name>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>api-docs-dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
||||
1
pom.xml
1
pom.xml
@ -50,6 +50,7 @@
|
||||
<jboss-logging-annotations.version>3.0.4.Final</jboss-logging-annotations.version> <!-- keep in sync with the version used by quarkus -->
|
||||
|
||||
<project.build-time>${timestamp}</project.build-time>
|
||||
<project.build-name>Keycloak</project.build-name>
|
||||
|
||||
<!-- Following properties are used for downstream build to alter final distribution archive file name and internal base directory of the archive. -->
|
||||
<dist.archive.file.prefix>keycloak</dist.archive.file.prefix>
|
||||
|
||||
2
quarkus/dist/src/main/version.txt
vendored
2
quarkus/dist/src/main/version.txt
vendored
@ -1 +1 @@
|
||||
Keycloak - Version ${project.version}
|
||||
${project.build-name} - Version ${project.version}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user