Reputation: 1953
How does one make Ivy resolve, retrieve, and freeze dynamic dependencies until the process is manually triggered again? I'm thinking of the case where someone is building release candidates and wants to insulate the build from all unnecessary changes.
I'm currently experimenting with a project that depends upon the latest.integration
revision of another project. In my ivy.xml file I have this:
<dependencies>
<dependency name="mylib" rev="latest.revision"/>
</dependencies>
For compilation, I put mylib onto the classpath in this way:
<ivy:cachepath organisation="myorg"
module="mylib"
revision="latest.integration"
pathid="mylib.jar.path.id"
inline="true"/>
<property name="file.reference.mylib.jar"
refid="mylib.jar.path.id"/>
</ivy:cachepath>
But, if I push a newer version of mylib to the repository and rebuild my project, this <ivy:cachepath>
task will re-resolve and re-retrieve mylib, which is exactly the opposite of what I want it to do.
I have tried <ivy:resolve>
, but it does not have the freezing effect I am looking for.
If this is just how Ivy works, that is OK. I'll just make the output of resolution write all the paths to a .properties file, and use the contents of that .properties file during compilation rather than all the Ivy business.
But, before I go down that path, I want to be sure I am not just misusing Ivy, as this seems like a use case that should be built in.
Upvotes: 0
Views: 217
Reputation: 78021
You're looking for the deliver task. For examples of its use:
I think you should also consider using a Maven repository manager that supports staging and promotion of artifacts. That way you build them once and use them continuously.
Upvotes: 1