From 53ba6ec5888db7f396deb123db9d1343cc065831 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sat, 24 Aug 2024 22:58:29 +0200 Subject: [PATCH] Make properties ordering stable Fixes #171 --- .../main/java/io/takari/maven/plugins/util/PropertiesWriter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/takari-lifecycle-plugin/src/main/java/io/takari/maven/plugins/util/PropertiesWriter.java b/takari-lifecycle-plugin/src/main/java/io/takari/maven/plugins/util/PropertiesWriter.java index 1e14676f..0e3339a8 100644 --- a/takari-lifecycle-plugin/src/main/java/io/takari/maven/plugins/util/PropertiesWriter.java +++ b/takari-lifecycle-plugin/src/main/java/io/takari/maven/plugins/util/PropertiesWriter.java @@ -35,6 +35,7 @@ public static void write(Properties properties, String comment, OutputStream out properties.store(sw, comment); List lines = new ArrayList<>(Arrays.asList(sw.toString().split("\\R"))); lines.remove(comment != null ? 1 : 0); + lines.sort(String::compareTo); // make lines ordering stable BufferedWriter w = new BufferedWriter(new OutputStreamWriter(out, ENCODING)); for (String line : lines) { w.write(line);