官网地址
https://poi.apache.org/index.html
POI & ooxml & ooxml-schemas
refer to: https://poi.apache.org/components/index.html
poi ooxml ooxml-schemas, 这3者是什么关系?分别有什么作用呢?
-
ooxml: Office Open XML
-
ooxml-schemas: To use the new OOXML file formats, POI requires a jar containing the file format XSDs, as compiled by XMLBeans. These XSDs, once compiled into Java classes, live in the org.openxmlformats.schemas namespace.
-
POI: Apache POI is also the master project for developing pure Java ports of file formats based on Office Open XML (ooxml).
关于ooxml-schemas,详细描述如下:
To use the new OOXML file formats, POI requires a jar containing the file format XSDs, as compiled by XMLBeans. These XSDs, once compiled into Java classes, live in the org.openxmlformats.schemas namespace.
There are two jar files available, as described in the components overview section. The full jar of all of the schemas is poi-ooxml-full-XXX.jar (previously known as ooxml-schemas) (lower versions for older releases, see table below), and it is currently around 16mb. The smaller poi-ooxml-lite (previously known as poi-ooxml-schemas) jar is only about 6mb. This latter jar file only contains the typically used parts though.
Many users choose to use the smaller poi-ooxml-lite jar to save space. However, the poi-ooxml-lite jar only contains the XSDs and classes that are typically used, as identified by the unit tests.
Every so often, you may try to use part of the file format which isn't included in the minimal poi-ooxml-lite jar. In this case, you should switch to the full poi-ooxml-full jar.
Longer term, you may also wish to submit a new unit test which uses the extra parts of the XSDs, so that a future poi-ooxml-lite jar will include them.
后续ooxml-schemas,不再维护了,从poi5.0开始,分为了poi-ooxml-full 和 poi-ooxml-lite
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-full -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-full</artifactId>
<version>5.2.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.5</version>
</dependency>
XMLBeans
refer to : https://xmlbeans.apache.org/
XMLBeans is a technology for accessing XML by binding it to Java types. XMLBeans provides several ways to get at the XML, including:
-
Through XML schema that has been compiled to generate Java types that represent schema types. In this way, you can access instances of the schema through JavaBeans-style accessors after the fashion of "getFoo" and "setFoo".
The XMLBeans API also allows you to reflect into the XML schema itself through an XML Schema Object model.
-
A cursor model through which you can traverse the full XML infoset.
-
Support for XML DOM.
升级到easyExcel 3.3.4 & poi 5.2.5
refer to : https://github.com/alibaba/easyexcel/issues/3817
现象描述:
easyexcel 3.3.4搭配poi 5.2.5使用时无法兼容poi-ooxml-full 5.2.5
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-full</artifactId>
<version>5.2.5</version>
</dependency>
原因:
找到真正原因了,不是兼容性问题,是org.apache.poi:ooxml-schemas:1.4
导致的异常,排除它就正常了,它也不是我主动引用的依赖项,是其它依赖项的间接引用带进来的,要不是有另一个正常导出的项目的引用依赖作对比,一时之间估计都找不出根源。
easyexcel官方:https://easyexcel.opensource.alibaba.com/qa/
3+版本的的easyexcel,使用poi 5+版本时,需要自己引入poi 5+版本的包,且手动排除:poi-ooxml-schemas,例如:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.4</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>