use of org.apache.maven.InternalErrorException in project kie-wb-common by kiegroup.
the class AFMavenCli method logSummary.
protected void logSummary(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) {
String referenceKey = "";
if (StringUtils.isNotEmpty(summary.getReference())) {
referenceKey = references.get(summary.getReference());
if (referenceKey == null) {
referenceKey = "[Help " + (references.size() + 1) + "]";
references.put(summary.getReference(), referenceKey);
}
}
String msg = summary.getMessage();
if (StringUtils.isNotEmpty(referenceKey)) {
if (msg.indexOf('\n') < 0) {
msg += " -> " + referenceKey;
} else {
msg += "\n-> " + referenceKey;
}
}
String[] lines = msg.split("(\r\n)|(\r)|(\n)");
for (int i = 0; i < lines.length; i++) {
String line = indent + lines[i].trim();
if ((i == lines.length - 1) && (showErrors || (summary.getException() instanceof InternalErrorException))) {
slf4jLogger.error(line, summary.getException());
} else {
slf4jLogger.error(line);
}
}
indent += " ";
for (ExceptionSummary child : summary.getChildren()) {
logSummary(child, references, indent, showErrors);
}
}
use of org.apache.maven.InternalErrorException in project kie-wb-common by kiegroup.
the class ReusableAFMavenCli method logSummary.
protected void logSummary(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) {
String referenceKey = "";
if (StringUtils.isNotEmpty(summary.getReference())) {
referenceKey = references.get(summary.getReference());
if (referenceKey == null) {
referenceKey = "[Help " + (references.size() + 1) + "]";
references.put(summary.getReference(), referenceKey);
}
}
String msg = summary.getMessage();
if (StringUtils.isNotEmpty(referenceKey)) {
if (msg.indexOf('\n') < 0) {
msg += " -> " + referenceKey;
} else {
msg += "\n-> " + referenceKey;
}
}
String[] lines = msg.split("(\r\n)|(\r)|(\n)");
for (int i = 0; i < lines.length; i++) {
String line = indent + lines[i].trim();
if ((i == lines.length - 1) && (showErrors || (summary.getException() instanceof InternalErrorException))) {
reusableSlf4jLogger.error(line, summary.getException());
} else {
reusableSlf4jLogger.error(line);
}
}
indent += " ";
for (ExceptionSummary child : summary.getChildren()) {
logSummary(child, references, indent, showErrors);
}
}
use of org.apache.maven.InternalErrorException in project kie-wb-common by kiegroup.
the class AFMavenCli method logSummary.
protected void logSummary(ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) {
String referenceKey = "";
if (StringUtils.isNotEmpty(summary.getReference())) {
referenceKey = references.get(summary.getReference());
if (referenceKey == null) {
referenceKey = "[Help " + (references.size() + 1) + "]";
references.put(summary.getReference(), referenceKey);
}
}
String msg = summary.getMessage();
if (StringUtils.isNotEmpty(referenceKey)) {
if (msg.indexOf('\n') < 0) {
msg += " -> " + referenceKey;
} else {
msg += "\n-> " + referenceKey;
}
}
String[] lines = msg.split("(\r\n)|(\r)|(\n)");
for (int i = 0; i < lines.length; i++) {
String line = indent + lines[i].trim();
if ((i == lines.length - 1) && (showErrors || (summary.getException() instanceof InternalErrorException))) {
slf4jLogger.error(line, summary.getException());
} else {
slf4jLogger.error(line);
}
}
indent += " ";
for (ExceptionSummary child : summary.getChildren()) {
logSummary(child, references, indent, showErrors);
}
}
Aggregations