I've been trying to write my own maven reporting plugin to generate info about tests when running 'mvn site'. The file test_report.html is created by the code below, but the page does not contain any title or text with the doxia sink API.
public class TestDocMojo extends AbstractMavenReport {
public String getOutputName() {
return "test_report";
}
public void executeReport(Locale locale) throws MavenReportException {
Sink sink = getSink();
sink.head();
sink.title("My maven site report");
sink.text("Content here.");
sink.flush();
sink.close();
}
}
I have been looking at this example: http://docs.codehaus.org/display/MAVENUSER/Write+your+own+report+plugin
you've made some small mistakes. Mainly closing stuff out.
title() just opens to the title for writing in doxia.
sink.title();
sink.text("Hello");
sink.title_();
Will write the title.
Now for the body.
sink.body();
sink.rawText("Hello World");
sink.body_();
Finally the full example :-
Sink sink = getSink();
sink.head();
sink.title();
sink.text("Hello");
sink.title_();
sink.head_();
sink.body();
sink.rawText("Hello World");
sink.body_();
sink.flush();
sink.close();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With