Publishing to and resolving from Local Ivy Cache by Example
<p>I think the most astonishing thing here is that this functionality is baked in by default to Maven and Gradle, yet, there are no traces of its existence in the Ant/Ivy landscape (see for yourself!).</p>

<hr>

<p>I have inherited a suite of JVM components that use Ant/Ivy as their build/dependency system. There are lots of dependencies between each of these components, which means making a change to one of them usually has a ripple effect requiring you to update Ivy dependencies and publish new version of upstream dependencies.</p>

<p>The old team maintaining these projects handled local development by publishing snapshot jars to a snapshot repo. <strong>I would like to replace this paradigm with a new one whereby snapshots are published to/resolved from the local Ivy cache.</strong></p>

<p>I was able to find <a href="https://stackoverflow.com/questions/8865187/ivy-resolving-and-publishing-jars-locally">this very similar question</a> but found the answer a bit lacking on details (particularly a fully stitched-together code snippet), in part because the question lacked any specific code examples. So I have created an <a href="http://sscce.org" rel="nofollow noreferrer">SSCCE</a> here and have pushed 2 GitHub repos:</p>

<ul>
<li><a href="https://github.com/hotmeatballsoup/fizzbuzz-model" rel="nofollow noreferrer">fizzbuzz-model</a>, a Java library that defines a data model (some meaningless POJOs)</li>
<li><a href="https://github.com/hotmeatballsoup/fizzbuzz-app" rel="nofollow noreferrer">fizzbuzz-app</a>, a simple executable jar that <em>depends on</em> <code>fizzbuzz-model</code> as a dependency</li>
</ul>

<p><strong>What I am looking for here are the <em>exact</em> (that is, <em>actual code</em>, not pseudo-code) changes (likely to <code>build.xml</code>, <code>ivy.xml</code> or <code>ivy-settings.xml</code>, or all three!) that will allow me to use the following local dev/test cycle:</strong></p>

<ol>
<li>I make a change to <code>fizzbuz-model</code> and publish the change locally to the Ivy cache, preferably as a snapshotted version (such as <code>1.0.0-SNAPSHOT</code> or similar)</li>
<li>From inside of the <code>fizzbuzz-app</code> root directory, I run <code>ant resolve</code> which pulls in those changes from the cached snapshot</li>
<li>Now I can make use of those changes in <code>fizzbuzz-app</code></li>
</ol>

<p>Though not a hard requirement, I would ideally like to <em>not</em> have to manage version numbers manually. That is, when I publish <code>fizzbuzz-model</code> locally, it <em>overwrites</em> the current binary with the same version (again, like <code>fizzbuz-model-1.0.0-SNAPSHOT.jar</code>) instead of incrementing the buildnumber to, say, <code>fizzbuzz-model-1.0.1-SNAPSHOT.jar</code> or similar). That way all I have to do when testing locally is publish <code>fizzbuzz-model</code> and resolve <code>fizzbuzz-app</code>.</p>

<p>Currently, when I publish <code>fizzbuzz-model</code>, I get the following errors:</p>

<pre><code>/Users/myuser/workspace/fizzbuzz-model/build.xml:52: impossible to publish artifacts for hotmeatballsoup#fizzbuzz-model;1.0: java.io.IOException: missing artifact hotmeatballsoup#fizzbuzz-model;1.0.0-SNAPSHOT!fizzbuzz-model.pom
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:225)
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:172)
</code></pre>

<p>To reproduce locally, clone both those projects and follow their READMEs, starting with <code>fizzbuzz-model</code>. <strong>Can anyone spot where I'm going awry?</strong> Feel free to answer here and/or submit a PR, whichever you prefer! And <strong>thanks!</strong></p>