title: How to build and unit test with Ivy?
body: <p>When unit testing with Ivy, is it best practice to put the test dependencies into the Ivy.xml file for the target binary you are building? Or should they be in a separate Ivy.xml file for the test project you are building?</p>
  
  <p>I'm using Ant build files on my Jenkins build server. </p>
  
  <p>Originally I planned to run the Unit test project after the target binary's build, but then my uploads to Artifactory got confused as the last ivy resolve was done for the test dependencies, not the target binary.</p>
  
  <p>If I place the test dependencies in the actual binary's Ivy.xml, I get the following error:</p>
  
  <p>"a module is not authorized to depend on itself"</p>
  
  <p>...but my test depends on the target binary that I'm building. </p>
  
  <p>Should the test project's Ivy.xml file not actually list the target binary as a dependency?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I have the dependencies now in the target binary's Ivy.xml.</p>
  
  <p>I've flagged the new depencencies as having a "test" configuration to set them apart from the dependencies needed for the target binary. </p>
  
  <p>I'm now working out how to point my test project at the binary produced by the build of the target project. I'm not sure if this is technically an issue with Ivy. </p>
  
  <p>After I build the target binary, should I have a relative path reference from the test project to the target binary? </p>
  
  <p>Another idea is to publish the target binary to the local cache, and then reference it from there in the target project. </p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I ended up using the ant copy task to copy the binary built from target project to the folder with the target project's dependencies in it. Since the test project dependencies are in this folder, the target project can locate the target binary. </p>