如何将Java JAR文件添加到Grails项目? [英] How to add Java JAR files to Grails project?
本文介绍了如何将Java JAR文件添加到Grails项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- 在我的本地maven仓库中安装JAR文件,并执行
grails install-dependency com.foo:my-project:0.0.1-SNAPSHOT
- 将JAR文件复制到
lib
文件夹的grails。 - 将
compile com.foo:my-project:0.0.1-SNAPSHOT
添加到依赖项BuildConfig.groovy
- 取消注释
mavenLocal()
并传递/home/me/.m2/repository
我可能尝试了其他几个如果方便的话,诸如迷信地投掷一个 grails clean
在每种情况下, grails compile
产生以下结果:编译失败,无法解析对任一JAR中任何类的所有引用。
任何想法我缺少什么?
解决方案
将jar放在lib文件夹中应该做招。我们正在使用同样的方法,目前没有问题。
I have a few Java/Maven projects that I want to use in a Grails 2.0.4 project. I have tried various approaches, such as:
- Installing the JAR files in my local maven repository, and executing
grails install-dependency com.foo:my-project:0.0.1-SNAPSHOT
- Copying the JAR files into the
lib
folder of grails. - Adding
compile com.foo:my-project:0.0.1-SNAPSHOT
to the dependencies section ofBuildConfig.groovy
- Uncommenting
mavenLocal()
and passing/home/me/.m2/repository
I may have tried a few other things, such as superstitiously throwing in a grails clean
whenever convenient. In every case grails compile
yields the following result: compilation fails, unable to resolve every reference to any of the classes in either of the JARs.
Any idea what I'm missing?
解决方案
Putting the jar in the lib folder should do the trick. We are using the same approach currently without problems.
这篇关于如何将Java JAR文件添加到Grails项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文