一.POI各个jar包用途,及处理Excel需要jar包

来源:互联网 发布:网易邮箱数据库在线查 编辑:程序博客网 时间:2024/06/05 17:02

   最近项目需要导出Excel表功能,研究了好多,最后决定用阿帕奇的POI;

    使用maven导入jar包时,发现POI有好多jar包,顿时不知应该导入那个,如果全部导入,使用应该没问题,但个人癖好是,用的导入,多余的不留,所以,又去官网查看一番,最后发现了下面这个东东:

Component Map

Apache POI分布包括对许多文档文件格式的支持。该支持在多个Jar文件中提供。并不是所有的jar包都是需要的。下表显示了POI组件、Maven存储库标记和项目Jar文件之间的关系。

ComponentApplication typeMaven artifactIdNotesPOIFSOLE2 FilesystempoiRequired to work with OLE2 / POIFS based filesHPSFOLE2 Property Setspoi HSSFExcel XLSpoiFor HSSF only, if common SS is needed see belowHSLFPowerPoint PPTpoi-scratchpad HWPFWord DOCpoi-scratchpad HDGFVisio VSDpoi-scratchpad HPBFPublisher PUBpoi-scratchpad HSMFOutlook MSGpoi-scratchpad DDFEscher common drawingspoi HWMFWMF drawingspoi-scratchpad OpenXML4JOOXMLpoi-ooxml plus either poi-ooxml-schemas or
ooxml-schemas and ooxml-securitySee notes below for differences between these optionsXSSFExcel XLSXpoi-ooxml XSLFPowerPoint PPTXpoi-ooxml XWPFWord DOCXpoi-ooxml XDGFVisio VSDXpoi-ooxml Common SLPowerPoint PPT and PPTXpoi-scratchpad and poi-ooxmlSL code is in the core POI jar, but implementations are in poi-scratchpad and poi-ooxml.Common SSExcel XLS and XLSXpoi-ooxmlWorkbookFactory and friends all require poi-ooxml, not just core poi


此表显示jar依赖关系。“version - yyymmdd”是POI版本。你可以在 downloads page. 看到最新信息;

Maven artifactIdPrerequisitesJARpoicommons-logging,commons-codec, commons-collections, log4jpoi-version-yyyymmdd.jarpoi-scratchpadpoipoi-scratchpad-version-yyyymmdd.jarpoi-ooxmlpoi,poi-ooxml-schemaspoi-ooxml-version-yyyymmdd.jarpoi-ooxml-schemasxmlbeanspoi-ooxml-schemas-version-yyyymmdd.jarpoi-examplespoi,poi-scratchpad, poi-ooxmlpoi-examples-version-yyyymmdd.jarooxml-schemasxmlbeansooxml-schemas-1.3.jarooxml-securityxmlbeans
For signing: bcpkix-jdk15on, bcprov-jdk15on, xmlsec, slf4j-api

ooxml-security-1.1.jar

 

    从上面表格中可以看出,如果只是处理Excel,我们只需导入poi,poi-ooxml, poi-ooxml-schemas就可;


原创粉丝点击