Fix issue with multiline comment in OSGI properties
If a component property as a multiline comment the app activation
will throw an exception and no property for that component would be initialized.
This patch address that in two ways:
- Make sure that if we cannot parse a line from cfgdef the other properties are enabled and logs a warn.
- Changes the onos-maven-plugin so that it removes new lines when generating the .cfgdef file
Bumping version as plugin is already published from onos-2.5 branch
Change-Id: I550c23624118782fe6d79c9abbaf75ae59ea0eab
diff --git a/core/net/src/main/java/org/onosproject/cfg/impl/ConfigPropertyDefinitions.java b/core/net/src/main/java/org/onosproject/cfg/impl/ConfigPropertyDefinitions.java
index e07773b..25ba6e0 100644
--- a/core/net/src/main/java/org/onosproject/cfg/impl/ConfigPropertyDefinitions.java
+++ b/core/net/src/main/java/org/onosproject/cfg/impl/ConfigPropertyDefinitions.java
@@ -75,6 +75,11 @@
while ((line = br.readLine()) != null) {
if (!line.isEmpty() && !line.startsWith(COMMENT)) {
String[] f = line.split(SEP, 4);
+ if (f.length < 4) {
+ log.warn("Cannot parse property from line: '{}'. " +
+ "This property will be ignored", line);
+ continue;
+ }
builder.add(defineProperty(f[0], Type.valueOf(f[1]), f[2], f[3]));
}
}