有新需求需要导出word文档;于是选择了Poi-tl,项目中已经使用了EasyExcel做相关Excel的导入与导出;当加入poi-tl做导出word时各种报错...
踩过的坑就不展示了....
下面是CV可用的,直接复制即可
<properties>
<poi-tl.version>1.12.0</poi-tl.version>
<poi.version>5.2.2</poi.version>
<poi-ooxml-schemas.version>4.1.2</poi-ooxml-schemas.version>
</properties>
<!--easy-excel-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>${easyexcel.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>${poi-tl.version}</version>
</dependency>
<!-- 冲突:java.lang.NoSuchMethodError: org.apache.poi.xwpf.usermodel.XWPFDocument.getDocComments()Lorg/apache/poi/xwpf/usermodel/XWPFComments;
-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- 冲突:java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.toByteArray(Ljava/io/InputStream;II)[B-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- 冲突:java.lang.NoClassDefFoundError: org/apache/xmlbeans/impl/schema/DocumentFactory-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi-ooxml-schemas.version}</version>
</dependency>
<!-- 冲突:java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.toByteArray(Ljava/io/InputStream;II)[B-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${poi.version}</version>
<scope>compile</scope>
</dependency>
...其他依赖...
标签:EasyExcel,Poi,tl,version,poi,apache,org
From: https://www.cnblogs.com/ybbit/p/18153916