我需要帮助执行命令"Ant clean all"。我将尝试构建SAP Hybris的一个应用程序,但是,有一个类将消除错误返回到行:
BOLDWEIGHT _BOLD无法解析或不是字段
有错误的方法:
@Override
public HSSFWorkbook createMDDExportFile(final List<JnJProductModel> products, final String fileName)
{
final String METHOD_NAME = "createMDDExportFile()";
LOGGER.info("JnJGTProductService" + Logging.HYPHEN + METHOD_NAME + Logging.HYPHEN + "Start of the method");
catalogVersionService.setSessionCatalogVersion(Jnjb2bCoreConstants.MDD_CATALOG_ID, Jnjb2bCoreConstants.ONLINE);
final String sheetName = "MDD_Products_Sheet_0";
final HSSFWorkbook excelWorkBook = new HSSFWorkbook();
final HSSFFont font = excelWorkBook.createFont();
ERROR=> font.setBoldweight(Font.BOLDWEIGHT_BOLD);
final HSSFCellStyle style = excelWorkBook.createCellStyle();
style.setFont(font);
final HSSFSheet sheet = excelWorkBook.createSheet(sheetName);
sheet.autoSizeColumn(0);
final HSSFRow downloadDateHeader = sheet.createRow(0);
downloadDateHeader.createCell(0).setCellValue("Download date");
downloadDateHeader.getCell(0).setCellStyle(style);
final String currentTime = new Date().toString();
downloadDateHeader.createCell(1).setCellValue(currentTime);
/*
* final HSSFRow globalAccounHeader = sheet.createRow(1);
* globalAccounHeader.createCell(0).setCellValue("Global Account Name");
* globalAccounHeader.getCell(0).setCellStyle(style);
* globalAccounHeader.createCell(1).setCellValue(currentAccount);
*/
try
{
final String filepath = Config.getParameter(Jnjb2bCoreConstants.EXPORT_EMAIL_ATTACHMENT_PATH_KEY) + File.separator
+ fileName;
createMDDExcelFile(products, sheet, excelWorkBook, style, filepath);
final File file = new File(filepath);
createMedia(file);
}
catch (final Exception exception)
{
LOGGER.error("There was an error while trying to create the excel file for the catalog export", exception);
}
LOGGER.info("JnJGTProductService" + Logging.HYPHEN + METHOD_NAME + Logging.HYPHEN + "End of the method");
return excelWorkBook;
}
您的maven版本与您正在访问的一个Font接口有问题。您导入了错误的Font接口路径。
是否检查字体界面是否包含BOLDWEIGHT _BOLD属性?
我的字体界面位于org.apache.poi.ss.usermodel.Font位置。