Add Jars to Grails Project Using Ivy

随声附和 提交于 2020-01-02 22:01:04

问题


I'm following the Grails Mail tutorial: http://grails.org/A+simple+EmailerService and it mentions "Then copy two jar files into the application local lib: activations.jar and mail.jar.". Though I can do the manual copy, I was wondering if there's some way I could update my Ivy configuration file to do that pulling automatically instead. I'm not familiar enough with Ivy at this point to know how to look for repositories, etc..


回答1:


First of all you need to install the ivy plugin:

grails install-plugin ivy

Then you can configure your ivy.xml:

<ivy-module version="2.0">
    <info organisation="apache" module="hello-ivy"/>
    <dependencies>
        <dependency org="commons-lang" name="commons-lang" rev="2.0"/>
        <dependency org="commons-cli" name="commons-cli" rev="1.0"/>
    </dependencies>
</ivy-module>

Finally, invoke the grails get-dependencies command.

The jars will then be downloaded in the project's lib directory.




回答2:


It depends on where you get your jars from. For info on Ivy and how it deals with dependencys see this link. http://www.ibm.com/developerworks/java/library/j-ap05068/index.html



来源:https://stackoverflow.com/questions/1336972/add-jars-to-grails-project-using-ivy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!