maven-release-plugin: fixed installing boot feature with missing config file.
@@ -65,7 +65,8 @@ public class ConfigInstaller {
for (Config config : content.getConfig()) {
if (pidMatching(config.getName())) {
Path configFile = etcDirectory.resolve(config.getName() + ".cfg");
- if (!config.isAppend() && Files.exists(configFile)) {
+ boolean configFileExist = Files.exists(configFile);
+ if (!config.isAppend() && configFileExist) {
LOGGER.info(" not changing existing config file: {}", homeDirectory.relativize(configFile));
continue;
}
@@ -84,8 +85,13 @@ public class ConfigInstaller {
});
} else {
if (config.isAppend()) {
+ if (configFileExist) {
LOGGER.info(" appending to config file: {}", homeDirectory.relativize(configFile));
Files.write(configFile, config.getValue().getBytes(), StandardOpenOption.APPEND);
+ }
+ else
+ LOGGER.warn(" Could not append, because config file does not exist: {}", homeDirectory.relativize(configFile));
+
} else {
LOGGER.info(" adding config file: {}", homeDirectory.relativize(configFile));
Files.write(configFile, config.getValue().getBytes());
