Browse Source

Merge branch 'master' of http://git.qmth.com.cn/ExamCloud-3/examcloud-web.git

WANG 5 years ago
parent
commit
dfea21c9ff

+ 9 - 5
src/main/java/cn/com/qmth/examcloud/web/bootstrap/AppBootstrap.java

@@ -79,8 +79,8 @@ public class AppBootstrap {
 			for (String arg : args) {
 				arg = arg.trim();
 				if (arg.startsWith("--")) {
-					String key = arg.substring(2, arg.indexOf("="));
-					String value = arg.substring(arg.indexOf("=") + 1);
+					String key = arg.substring(2, arg.indexOf("=")).trim();
+					String value = arg.substring(arg.indexOf("=") + 1).trim();
 					properties.put(key, value);
 				}
 			}
@@ -97,11 +97,15 @@ public class AppBootstrap {
 
 		Set<String> argSet = Sets.newLinkedHashSet();
 		for (Entry<String, String> p : properties.entrySet()) {
-			if (StringUtils.isBlank(p.getValue())) {
+			String key = p.getKey();
+			String value = p.getValue();
+			if (StringUtils.isBlank(key) || StringUtils.isBlank(value)) {
 				continue;
 			}
-			PropertyHolder.setProperty(p.getKey(), p.getValue());
-			String arg = "--" + p.getKey() + "=" + p.getValue();
+			key = key.trim();
+			value = value.trim();
+			PropertyHolder.setProperty(key, value);
+			String arg = "--" + key + "=" + value;
 			argSet.add(arg);
 		}