title: How does ivy:publish work?
body: <p>I'm completely at loss how the ant task ivy:publish is supposed to work.</p>
  
  <p>I would expect that I do my normal build, which creates a bunch of jar files, then I would push those jars to the (local) repository.</p>
  
  <p>How can I specify from where to retrieve the built jars, and how would those end up in the repository?</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>&lt;target name="publish-local" description="--&gt; Publish Local"&gt;
      &lt;ivy:retrieve /&gt;
      &lt;ivy:publish resolver="local" pubrevision="${release.version}" status="release" update="true" overwrite="true"&gt;
          &lt;artifacts pattern="${dist.dir}/[organisation]-[module].[ext]" /&gt;
      &lt;/ivy:publish&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>this actually works, I didn't include the retrieve before. </p>
  
  <p>But I still have some problems, suppose I want to publish 3 jars, openscada-utils.jar, openscada-utils-sources.jar and openscada-utils-javadocs.jar as openscada-utils-0.9.2.jar, openscada-utils-0.9.2-sources.jar and openscada-utils-0.9.2-javadocs.jar</p>
  
  <p>It isn't entirely clear to me, how the actual names are assembled, and where I can specify which names they should get. (Using the fragment above, the jars are always called only utils.jar).</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>I got it to work (a bit), but it still doesn't feel right. Somehow all tutorials focus on dependencies from 3rd party projects, but an equally important point for me is to handle project specific dependencies.</p>
  
  <p>I have a bunch of sub projects which depend on each other in various ways. Considering ivy:publish it is not clear to me how to start.</p>
  
  <ol>
  <li><p>How do I handle the first version? I have a common version number for all sub projects to indicate that they belong together (lets say 0.9). Therefore the first revision should be 0.9.0, but so far nothing of my projects is in my repository. How do I get Ivy to assign this revision number.</p></li>
  <li><p>In the course of developing I want to publish the built files again, without changing the revision number so far.</p></li>
  <li><p>If I'm finished with my work I want to push it to a shared repository (and increase the revision number lets say from 0.9.0 to 0.9.1), what is the recommended approach to do so?</p></li>
  <li><p>For an actual release, I want to make distributions with dependencies and without, somehow I guess I can use different configurations for that. How can I use that to my advantage?</p></li>
  </ol>