As I run my below script to read data from excel functionality locally no issues in the execution.
public String getCellDataString(String sheetName, int rowNum, int colNum) throws IOException {
File file = new File(System.getProperty("user.dir")+"/excel/ExcelWorkBook.xlsx");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet sheet = wb.getSheet(sheetName);
String cellData = sheet.getRow(rowNum).getCell(colNum).getStringCellValue();
return cellData;
}
I have all apache-poi added to pom.xml.
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>openxml4j</artifactId>
<version>1.0-beta</version>
</dependency>
As I upload to Azure DevOps and build, I get a package org.apache.poi.hssf.usermodel does not exist error for each of the imports and build failed.
- package org.apache.poi.xssf.usermodel does not exist
- cannot find symbol
I did tried below links but could not find any solution,
I see that Azure Devops unable to download sources, May I please know what am I missing ?