Required maven dependencies for Apache POI to work

前端 未结 10 953
长情又很酷
长情又很酷 2021-01-03 19:17

I want to use Apache POI library to parse excel files (old versions and newer versions of excel). So I was wondering what jars do i need to include from the Apache POI becau

相关标签:
10条回答
  • 2021-01-03 20:03

    If you are not using maven, then you will need **

    • poi
    • poi-ooxml
    • xmlbeans
    • dom4j
    • poi-ooxml-schemas
    • stax-api
    • ooxml-schemas
    0 讨论(0)
  • 2021-01-03 20:09

    I used the below dependency. If you are using Selenium then it's good to use all of them as below. Else you will see some errors and then do the reserch and add some more dependencies.

    <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>poi</artifactId>
                     <version>3.9</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>poi-ooxml</artifactId>
                     <version>3.9</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>poi-ooxml-schemas</artifactId>
                     <version>3.9</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>poi-scratchpad</artifactId>
                     <version>3.9</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>ooxml-schemas</artifactId>
                     <version>1.1</version>
              </dependency>
    
              <dependency>
                     <groupId>org.apache.poi</groupId>
                     <artifactId>openxml4j</artifactId>
                     <version>1.0-beta</version>
              </dependency>
    
    0 讨论(0)
  • 2021-01-03 20:09

    Add this dependency to work with Apache POI

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.16-beta1</version>
     </dependency>
    
    0 讨论(0)
  • 2021-01-03 20:10

    ooxml for dealing the .xlsx files and the ooxml refers to the xml, hence we will be needed to refer the below three dependedncies in the pom.xml for the

    <dependency>
       <groupId>org.apache.poi</groupId>
       <artifactId>poi</artifactId>
       <version>3.9</version>
    </dependency>
    <dependency>
       <groupId>xml-apis</groupId>
       <artifactId>xml-apis</artifactId>
       <version>1.4.01</version>
    </dependency>
    <dependency>
       <groupId>org.apache.poi</groupId>
       <artifactId>poi-ooxml</artifactId>
       <version>3.9</version>
       <exclusions>
         <exclusion>
           <artifactId>xml-apis</artifactId>
           <groupId>xml-apis</groupId>
         </exclusion>       
       </exclusions>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题