- 下载ReportNg源码
git clone https://github.com/dwdyer/reportng.git
- 修改AbstractReporter.java(该文件的所在目录为
xxx\reportng\reportng\src\java\main\org\uncommons\reportng
)
protected void generateFile(File file,
String templateName,
VelocityContext context) throws Exception
{
// Writer writer = new BufferedWriter(new FileWriter(file));
OutputStream out = new FileOutputStream(file);
Writer writer = new BufferedWriter(new OutputStreamWriter(out, "utf-8"));
try
{
Velocity.mergeTemplate(classpathPrefix + templateName,
ENCODING,
context,
writer);
writer.flush();
}
finally
{
writer.close();
}
}
3.编译源码
cd reportng # 进入目录xxx\reportng\reportng
ant # 若无ant,则需搭建