title: How to publish custom jars to local Apache Ivy repository
body: <p><br/>
  I've read all the tutorials and examples, and still cannot publish a set of custom jars in my local Ivy repository. 
  <br/> <strong>Edit: Basically I want the same behavior as maven-install-plugin.</strong><br/>
  Here's my setup. I have an Ant task which produces the jars in a given folder. The folder name is not fixed but rather passed as a property in file. I want to get all the jars in this folder and install them in my local Ivy repo so that I can use them on a next step.
  <br/>Here is my Ant from where I call the ivy:publish:<br/></p>
  
  <pre><code>&lt;project name="Install Ivy Dependencies" xmlns:ivy="antlib:org.apache.ivy.ant" basedir="." default="publish"&gt;
  
      &lt;loadproperties srcFile="path_to_folder.properties"/&gt;
  
   &lt;property name="file_pattern" value="${path_to_folder}/[artifact].[ext]" /&gt;
   &lt;property name="pub_revision" value="1.0.0" /&gt;
  
     &lt;target name="resolve"&gt;
          &lt;ivy:configure file="ivysettings.xml" /&gt;
          &lt;ivy:resolve file="ivy.xml" /&gt;
    &lt;/target&gt;
  
   &lt;target name="retrieve-all" depends="resolve"&gt;
          &lt;ivy:retrieve pattern="${file_pattern}" conf="*" /&gt;
   &lt;/target&gt;
  
   &lt;target name="publish"  depends="retrieve-all"&gt;
          &lt;ivy:publish resolver="local" organisation="myOrg" update="true" overwrite="true" pubrevision="${pub_revision}"&gt;
             &lt;artifacts pattern="${file_pattern}"/&gt;
          &lt;/ivy:publish&gt;
   &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><br/>Here's my ivysettings.xml:<br/></p>
  
  <pre><code>&lt;ivysettings&gt;
    &lt;resolvers&gt;
        &lt;filesystem name="local" local="true"/&gt;
      &lt;/resolvers&gt;
  &lt;/ivysettings&gt;
  </code></pre>
  
  <p><br/>And the ivy.xml:<br/></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"&gt;
  
    &lt;info organisation="myOrg" module="myModule" revision="1.0.0"/&gt;
    &lt;publications&gt;
      &lt;artifact name="my-custom-jar" ext="jar" type="jar"/&gt;
      &lt;artifact name="my-custom-jar-source" ext="jar" type="source"/&gt;
    &lt;/publications&gt;
  &lt;/ivy-module&gt;
  </code></pre>
  
  <p>The error that I am getting when I call the ant task is:<br/>
  <strong>impossible to publish artifacts for myOrg#myModule;1.0.0: java.lang.IllegalStateException: impossible to publish myOrg#myModule;1.0.0!my-custom-jar.jar using local: no artifact pattern defined</strong></p>