简体   繁体   English

在Grails应用程序上集成开源Java库

[英]Integrating a open source java lib on grails application

I want to intergate the apache tika jar or source files into my grail application and how can i do it please ... 我想将apache tika jar或源文件插入到我的grail应用程序中,我该怎么做...

what about access source files into my groovy controller or something 如何将源文件访问到我的groovy控制器中

There are a lot's of way to include jar on a grails project, however i think that te best way is using maven. 在grails项目中包含jar的方法有很多,但是我认为最好的方法是使用Maven。

<dependency>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-core</artifactId>
    <version>...</version>
 </dependency>

add on your BuildConfig.groovy file 在您的BuildConfig.groovy文件上添加

dependencies {
  ...
  compile'org.apache.tika:tika-core:1.7'
  ...
}

试试grails apache tika插件http://grails.org/plugin/tika-parser

there is a thrird option. 有一个第三选择。 you can put the downloaded .jar file into the /lib dir of your grails project. 您可以将下载的.jar文件放入grails项目的/lib目录中。 do grails package and it should get picked up. grails package ,它应该拿起。 this of course is a much inferior solution, than just using a plug-in or dependencies, but might come handy. 当然,这不仅仅是一个插件或依赖项,它是一个劣等的解决方案,但可能会派上用场。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM