Use sorted properties to make build info output repeatable

Closes gh-14494
This commit is contained in:
Andy Wilkinson
2019-05-28 16:30:36 +01:00
parent 6de14f71c6
commit c80218064f
2 changed files with 23 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@ import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.Properties;
import org.springframework.core.CollectionFactory;
/**
* A {@code BuildPropertiesWriter} writes the {@code build-info.properties} for
* consumption by the Actuator.
@@ -68,7 +70,7 @@ public final class BuildPropertiesWriter {
}
protected Properties createBuildInfo(ProjectDetails project) {
Properties properties = new Properties();
Properties properties = CollectionFactory.createSortedProperties(true);
properties.put("build.group", project.getGroup());
properties.put("build.artifact", project.getArtifact());
properties.put("build.name", project.getName());