io.sealights.agents.plugin.BuildFailureFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sealights-maven-plugin
Show all versions of sealights-maven-plugin
A maven plugin to run java agents.
package io.sealights.agents.plugin;
import java.util.List;
import io.sealights.agents.plugin.MavenEventsListener.FailedProjectInfo;
public class BuildFailureFormatter {
public static final String BUILD_SUBPROJECTS_FAILED = "Build failed due to sub-projects failure";
public final static String SPECIAL_CHAR = "\u001B[";
public final static String EOF_LINE = "\n";
private final static String EOF_SPECIAL_CHAR = "m";
public static String format(String rawString) {
String converted = rawString;
for (;;) {
String tmp = extractNextSpecialChar(converted);
if (tmp==null) break;
else converted = tmp;
}
return converted.replace(EOF_LINE, "");
}
public static String collectFailures(FailedProjectInfo buildFailure, List projectsFailures) {
if (projectsFailures.isEmpty()) {
return buildFailure.reason;
}
StringBuilder builder = new StringBuilder();
builder.append(buildFailure.reason).append(": {" );
int ctr = 0;
int last = projectsFailures.size() -1;
for (FailedProjectInfo fi: projectsFailures) {
builder.append(String.format("\nproject:'%s', failure: '%s'", fi.projectName, fi.reason));
if (ctr
© 2015 - 2025 Weber Informatics LLC | Privacy Policy