Skip to content

Commit a41ca05

Browse files
committed
Default to empty string if description in plugin.xml is not set
Closes gh-20890
1 parent 6cec018 commit a41ca05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -99,9 +99,10 @@ private List<Parameter> parseParameters(Node mojoNode) throws XPathExpressionExc
9999

100100
private Parameter parseParameter(Node parameterNode, Map<String, String> defaultValues,
101101
Map<String, String> userProperties) throws XPathExpressionException {
102+
String description = textAt("description", parameterNode);
102103
return new Parameter(textAt("name", parameterNode), textAt("type", parameterNode),
103104
booleanAt("required", parameterNode), booleanAt("editable", parameterNode),
104-
format(textAt("description", parameterNode)), defaultValues.get(textAt("name", parameterNode)),
105+
(description != null) ? format(description) : "", defaultValues.get(textAt("name", parameterNode)),
105106
userProperties.get(textAt("name", parameterNode)), textAt("since", parameterNode));
106107
}
107108

0 commit comments

Comments
 (0)