integrated Maven console annotation to the native m2 project

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34835 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-09-15 17:57:09 +00:00
1 parent b560509f70
commit 05dd7f8d4f
5 files changed
+25 -13

No files matched your search

@@ -61,11 +61,11 @@ public class MavenConsoleAnnotator extends LineTransformationOutputStream {
new MavenMojoNote().encodeTo(out);
m = MavenWarningNote.PATTERN.matcher(line);
if (m.matches())
if (m.find())
new MavenWarningNote().encodeTo(out);
m = MavenErrorNote.PATTERN.matcher(line);
if (m.matches())
if (m.find())
new MavenErrorNote().encodeTo(out);
out.write(b,0,len);
@@ -40,9 +40,7 @@ public class MavenErrorNote extends ConsoleNote {
@Override
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
MarkupText.SubText t = text.findToken(Pattern.compile("^[^:]+(?=:)"));
if (t!=null)
t.addMarkup(0,t.length(),"<span class=error-inline>","</span>");
text.addMarkup(0,text.length(),"<span class=error-inline>","</span>");
return null;
}
@@ -45,9 +45,7 @@ public class MavenMojoNote extends ConsoleNote {
@Override
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
MarkupText.SubText t = text.findToken(Pattern.compile("^[^:]+(?=:)"));
if (t!=null)
t.addMarkup(7,t.length(),"<b class=maven-mojo>","</b>");
text.addMarkup(7,text.length(),"<b class=maven-mojo>","</b>");
return null;
}
@@ -58,5 +56,5 @@ public class MavenMojoNote extends ConsoleNote {
}
}
public static Pattern PATTERN = Pattern.compile("\\[INFO\\] \\[\\w+:\\w+ \\{execution: \\w+\\}\\]");
public static Pattern PATTERN = Pattern.compile("\\[INFO\\] \\[[A-Za-z0-9-_]+:[A-Za-z0-9-_]+ \\{execution: [A-Za-z0-9-_]+\\}\\]");
}
@@ -42,9 +42,7 @@ public class MavenWarningNote extends ConsoleNote {
@Override
public ConsoleAnnotator annotate(Object context, MarkupText text, int charPos) {
MarkupText.SubText t = text.findToken(Pattern.compile("^[^:]+(?=:)"));
if (t!=null)
t.addMarkup(0,t.length(),"<span class=warning-inline>","</span>");
text.addMarkup(0,text.length(),"<span class=warning-inline>","</span>");
return null;
}