我对Grails还是有点绿。在我看来,您可以在多个位置放置依赖的JAR,其中包括BuildConfig.groovy,然后在grails文件夹中有Dependencies.txt,然后也可以有n个“lib”文件夹。
这些有什么区别?什么时候使用另一个?为什么Grails不能在一个中心位置保留所有依赖项?
最佳答案
管理依赖性的首选方法是BuildConfig.groovy
,因为它使用存储库(例如Maven)来使这些资源可用。
可以使用grails-app/lib
的原因是,在某些情况下,由于某种原因资源没有保留在资源库中,因此您需要一种将资源直接包含在应用程序本身中的方法。
如有疑问,请始终使用BuildConfig.groovy
,除非您有无法使用的用例。
更新dependencies.txt
文件只是Grails使用的依赖项列表,而不用于解析它们。您可以在documentation中了解更多信息。
You can find a list of dependencies required by Grails in the "dependencies.txt" file in the root directory of the unpacked distribution.
关于grails - 在grails应用程序中管理依赖关系(BuildConfig.groovy与dependencies.txt),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36553452/