I used Ivy a bit, but I seem to have a lot to learn.
I have two projects. One is the web application, and the other is the library on which the web application depends. The setup is that the library project is compiled into a jar file and published using Ivy in the directory inside the project. In the web application build file, I have an ant target that causes the Ivy task to solve ant.
I would like the web application to use the dynamic resolution mode during development (on local computers of developers) and the default resolution mode for test and production assemblies. I used to add a timestamp to the library archive file so Ivy would notice changes in the file when the web application tried to resolve its dependency on it. In Eclipse, this is cumbersome because the project needs to be updated in the web application and the build path changed every time a new library is published. I believe that the publication of the so-called jar file every time, as it seems to me, requires developers to only update the project.
The problem is that the web application cannot get the dynamic jar file.
The result I get looks something like this:
resolve: [ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ :: [ivy:configure] :: loading settings :: file = /Users/richard/workspace/webapp/web/WEB-INF/config/ivy/ivysettings.xml [ivy:resolve] :: resolving dependencies :: com.webapp
The goal of the solution for solving the web application is as follows:
<target name="resolve" depends="load-ivy"> <ivy:configure file="${ivy.dir}/ivysettings.xml" /> <ivy:resolve file="${ivy.dir}/ivy.xml" resolveMode="${ivy.resolve.mode}"/> <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" type="jar" sync="true" /> </target>
In this case, ivy.resolve.mode is set to "dynamic" (without quotes).
The Ivy file for web applications is simple. It looks like this:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"> <info organisation="com.webapp" module="webapp"/> <dependencies> <dependency name="library" rev="${ivy.revision.default}" revConstraint="${ivy.revision.dynamic}" /> </dependencies> </ivy-module>
At development time, ivy.revision.dynamic is set to "last.integration". Although during production or test, the value of "ivy.revision.default" is set to "1.0".
Any ideas? Please let me know if you need more information.
Thanks!