【发布时间】:2014-07-15 21:45:13
【问题描述】:
我有一个 grails 应用程序,并且 /src/groovy 下的 groovy 具有 Java POI HSSF 的导入语句 例如
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.apache.poi.hssf.usermodel.HSSFCellStyle
将 POI 添加到我的 grails 应用程序以便它与战争一起部署的最佳方式是什么。我尝试将 jars 添加到 /lib,然后将它们作为运行时依赖项添加到 BuilConfig.groovy 中。
dependencies {
runtime 'mysql:mysql-connector-java:5.1.22'
runtime 'poi-3.9-20121203'
runtime 'poi-ooxml-3.9'
runtime 'poi-ooxml-schemas-3.9'
runtime 'xml-apis-ext-1.3.04'
runtime 'xmlbeans-2.3.0'
runtime 'xmlpull-1.1.3.1'
runtime 'xstream-1.4.7'
}
我也试过以这种方式将它添加为编译插件
plugins {
runtime ":hibernate:3.6.10.13"
compile ":excel-import:1.0.0"
}
两者都在 grails 战争中产生此错误
java.lang.NoClassDefFoundError: _GrailsClasspath_groovy$_run_closure1
编辑:我的存储库有 maven,但仍然抱怨缺少 class def Read jars from lib folder in grails
【问题讨论】:
标签: grails groovy apache-poi