Springboot resource 下的excel

现象
在JAVA的resources文件夹中放置了execl模板,想要在读取模板的基础上编辑并下载,结果在转换为workbook时,报以下问题:

org.apache.poi.openxml4j.exceptions.InvalidOperationException: Could not open the specified zip entry source stream
    org.apache.poi.openxml4j.opc.ZipPackage.openZipEntrySourceStream(ZipPackage.java:205)
    org.apache.poi.openxml4j.opc.ZipPackage.openZipEntrySourceStream(ZipPackage.java:187)
    org.apache.poi.openxml4j.opc.ZipPackage.openZipEntrySourceStream(ZipPackage.java:161)
    ......

解决
maven编译命令中追加相关除外条件解决,详见以下的nonFilteredFileExtension配置:


    org.apache.maven.plugins
    maven-resources-plugin
    3.0.2
    
        utf-8
        true
        
            cer
            jks
            p12
            
            xlsx
            xls
            docx
            doc
        
    

你可能感兴趣的:(Java,spring,boot,后端,java)