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..
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.
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