jenkins pipeline import org.apache.poi

Viewed 19

I am trying to automate with excel and can't import the org.apache.poi for use.

I try something like this:

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

pipeline {
 agent any

  stages {
    stage('excel') {
      steps {
        script {
            SXSSFWorkbook wb = new SXSSFWorkbook(100);
        }
      }
    }

  }
}

and get "unable to resolve class org.apache.poi.ss.usermodel.Row" with all of them. In the script part the error is the same: "unable to resolve class SXSSFWorkbook".

If I download the jar file from search.maven.org where do I put it to be used?

1 Answers

If you are running on Tomcat you can add them to <TOMCAT_HOME>/lib directory. Else you can add them to your JDK itself, into $JAVA_HOME/jre/lib/ext/

Related