Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec21f4b

Browse files
Update formatting of prerequisites-requirements error to improve readability
Message at the end of error line is not readable ... so add some new lines and tabs to make it more readable
1 parent f839cc1 commit ec21f4b

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

maven-core/src/main/java/org/apache/maven/plugin/MavenPluginPrerequisitesChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public interface MavenPluginPrerequisitesChecker extends Consumer<PluginDescriptor> {
3232
/**
3333
*
34-
* @param pluginDescriptor
34+
* @param pluginDescriptor the plugin descriptor to check
3535
* @throws IllegalStateException in case the checked prerequisites are not met
3636
*/
3737
@Override

maven-core/src/main/java/org/apache/maven/plugin/PluginIncompatibleException.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
public class PluginIncompatibleException extends PluginManagerException {
2727

2828
public PluginIncompatibleException(Plugin plugin, String message) {
29-
this(plugin, message, null);
30-
}
31-
32-
public PluginIncompatibleException(Plugin plugin, String message, Throwable cause) {
33-
super(plugin, message, cause);
29+
super(plugin, message, (Throwable) null);
3430
}
3531
}

maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ public void checkPrerequisites(PluginDescriptor pluginDescriptor) throws PluginI
296296
});
297297
// aggregate all exceptions
298298
if (!prerequisiteExceptions.isEmpty()) {
299+
String ln = System.lineSeparator();
299300
String messages = prerequisiteExceptions.stream()
300301
.map(IllegalStateException::getMessage)
301-
.collect(Collectors.joining(", "));
302+
.collect(Collectors.joining(ln + '\t'));
302303
PluginIncompatibleException pie = new PluginIncompatibleException(
303304
pluginDescriptor.getPlugin(),
304-
"The plugin " + pluginDescriptor.getId() + " has unmet prerequisites: " + messages,
305-
prerequisiteExceptions.get(0));
306-
// the first exception is added as cause, all other ones as suppressed exceptions
307-
prerequisiteExceptions.stream().skip(1).forEach(pie::addSuppressed);
305+
ln + "The plugin " + pluginDescriptor.getId() + " has unmet prerequisites: " + ln + '\t'
306+
+ messages);
307+
prerequisiteExceptions.forEach(pie::addSuppressed);
308308
throw pie;
309309
}
310310
}

0 commit comments

Comments
 (0)