Write hyperlink to Excel error org.codehaus.groovy.GroovyBugError: BUG! exception in phase 'semantic

Hello, I am trying to write hyper link to an excel file and error for the script below.

Other excel writing works, just hyper link is having issue. I did not have to import any external POI jar for plain Excel text writing.

--- ERROR —

Test Cases/Test FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

file:/D:/xxx/Script1518641414246.groovy: 34: unable to resolve class org.apache.poi.common.usermodel.HyperlinkType

@ line 34, column 1.

import org.apache.poi.common.usermodel.HyperlinkType as HyperlinkType

https://poi.apache.org/download.html

If I download POI jars and import them into the project, then this new error:

Test Cases/GetIssues FAILED because (of) org.codehaus.groovy.GroovyBugError: BUG! exception in phase ‘semantic analysis’ in source unit ‘file:/D:/xxx/Script1518641414246.groovy’ class “org.apache.poi.common.usermodel.HyperlinkType”'s signer information does not match signer information of other classes in the same package

--- Below is snippet of my Excel hyperlink script —

[…]

import org.apache.poi.hssf.usermodel.HSSFWorkbook as HSSFWorkbook

import org.apache.poi.hssf.usermodel.HSSFSheet as HSSFSheet

import org.apache.poi.hssf.usermodel.HSSFRow as HSSFRow

import org.apache.poi.hssf.usermodel.HSSFCell as HSSFCell

import org.apache.poi.common.usermodel.HyperlinkType as HyperlinkType

import org.apache.poi.hssf.usermodel.HSSFHyperlink as HSSFHyperlink

import org.apache.poi.hssf.usermodel.HSSFCellStyle as HSSFCellStyle

import org.apache.poi.hssf.usermodel.HSSFCreationHelper as HSSFCreationHelper

import org.apache.poi.hssf.usermodel.HSSFFont as HSSFFont

[…]

row.createCell(0).setCellValue(“Try Excel link”);

row.createCell(1).setCellValue(“Google link”);

//cell style for hyperlinks default hyperlinks are blue and underlined

HSSFCellStyle hlink_style = wb.createCellStyle();

HSSFFont hlink_font = wb.createFont();

hlink_font.setUnderline(Font.U_SINGLE);

hlink_font.setColor(HSSFColorPredefined.BLUE.getIndex());

hlink_style.setFont(hlink_font);

HSSFHyperlink link = helper.createHyperlink(HyperlinkType.URL);

link.setAddress(“www.google.com”);

row.createCell(1).setHyperlink(link);

row.createCell(1).setCellStyle(hlink_style);

FileOutputStream fout=new FileOutputStream(f1);

wb.write(fout);