Java 之 POI各Jar包作用

  目前POI的最新版本是 3.16-beta2,该版本是测试版本,稳定版本是 3.15,下载地址为 Apache POI  (http://poi.apache.org/download.html)。

一、目录结构

  目录结构如下:

  

  

  

二、详细介绍

  官方地址:https://poi.apache.org/overview.html。

Maven artifactIdPrerequisitesJARNotes
poi-excelantpoi,poi-ooxmlpoi-excelant-version.jar用于读取表格、写入表格等一系列操作表格所用到的包

  Component Map

  The Apache POI distribution consists of support for many document file formats. This support is provided in several Jar files. Not all of the Jars are needed for every format. The following tables show the relationships between POI components, Maven repository tags, and the project's Jar files.

ComponentApplication typeMaven artifactIdNotes
POIFSOLE2 FilesystempoiRequired to work with OLE2 / POIFS based files
HPSFOLE2 Property Setspoi 
HSSFExcel XLSpoiFor HSSF only, if common SS is needed see below
HSLFPowerPoint 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-security
See notes below for differences between these options
XSSFExcel 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

  This table maps artifacts into the jar file name. "version-yyyymmdd" is the POI version stamp. You can see what the latest stamp is on the downloads page.      

Maven artifactIdPrerequisitesJAR
poicommons-logging, commons-codec, commons-collections, log4j poi-version-yyyymmdd.jar
poi-scratchpadpoipoi-scratchpad-version-yyyymmdd.jar
poi-ooxmlpoi, poi-ooxml-schemas poi-ooxml-version-yyyymmdd.jar
poi-ooxml-schemasxmlbeanspoi-ooxml-schemas-version-yyyymmdd.jar
poi-examplespoi, poi-scratchpad, poi-ooxml poi-examples-version-yyyymmdd.jar
ooxml-schemasxmlbeansooxml-schemas-1.3.jar
ooxml-securityxmlbeans
For signing: bcpkix-jdk15on, bcprov-jdk15on, xmlsec, slf4j-api
ooxml-security-1.1.jar

  Note:Apache commons-collections4 was added as a dependency in POI 3.15 beta 3.      

  poi-ooxml requires poi-ooxml-schemas. This is a substantially smaller version of the ooxml-schemas jar (ooxml-schemas-1.3.jar for POI 3.14 or later, ooxml-schemas-1.1.jar for POI 3.7 up to POI 3.13, ooxml-schemas-1.0.jar for POI 3.5 and 3.6). The larger ooxml-schemas jar is normally only required for development. Similarly, the ooxml-security jar, which contains all of the classes relating to encryption and signing, is normally only required for development. A subset of its contents are in poi-ooxml-schemas. This JAR is ooxml-security-1.1.jar for POI 3.14 onwards and ooxml-security-1.0.jar prior to that.

  The OOXML jars require a stax implementation, but now that Apache POI requires Java 6, that dependency is provided by the JRE and no additional stax jars are required. The OOXML jars used to require DOM4J, but the code has now been changed to use JAXP and no additional dom4j jars are required. By the way, look at this FAQ if you have problems when using a non-Oracle JDK.

  The ooxml schemas jars are compiled with Apache XMLBeans 2.3, and so can be used at runtime with any version of XMLBeans from 2.3 or newer. Wherever possible though, we recommend that you use XMLBeans 2.6.0 with Apache POI, and that is the version now shipped in the binary release packages.

  总结:按照需要导入jar包及相关依赖jar包。

  poi-3.15.jar  (excel文件生成需要)

  poi-examples-3.15.jar(官方示例,开发不需要) 

  poi-excelant-3.15.jar(不需要)

  poi-ooxml-3.15.jar(excel,word,ppt均需要)

  poi-ooxml-schemas-3.15.jar(excel需要)

  poi-scratchpad-3.15.jar(ppt,vsd,word,viso,outlook等需要)

转载于:https://www.cnblogs.com/xinaixia/p/6707868.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值