I was able to "solve" my problem, although it is using a much less than satisfying mechanism.
I had to script an ANT copy to duplicate the following files in the .ivy2/cache directory before the call to publish: resolved-spe-ste-batch-work...@sandbox.xml resolved-spe-ste-batch-working@sandbox.properties to these file names: resolved-spe-ste-batch-1.0.2.xml resolved-spe-ste-batch-1.0.2.properties Additionally, I needed to replace the string "working@sandbox" to "1.0.2" in those files as well. The files being copied were newly created from the ANT script, and thus contained the latest resolved dependencies. This "simulated" the deliver task of the publish which I thought would have created these files automatically, but didn't. I've examined other examples of publish tasks online, notably this one: http://ivysvn.googlecode.com/svn/trunk/ivy-common-targets.xml and I am essentially performing the exact same series of tasks, and am getting less than acceptable results. Obviously, I still need some assistance in understanding the failure here, but I have a horrible workaround at the very least, which will allow me to publish this artifact to Nexus. I am using IVY 2.2.0-RC1. I'll be upgrading this when I get a chance, and I'll report back my results. Additionally, this is obviously going into a SNAPSHOT repo, which also appears to be related in this entire mess, and I'm sure I probably need to append -SNAPSHOT to files to get all this to work properly, most likely. As always, any thoughts, hints, suggestions or thoroughly explicit instructions and analysis would be greatly appreciated. :) Many thanks in advance, Shaka On Wed, Jun 29, 2011 at 7:14 PM, Shaka Tard <shakat...@gmail.com> wrote: > I'm writing to see if anyone else is having this issue with Ivy, or whether > I am doing wrongly. I apologize profusely, but I have not found any > satisfactory answer to my problem in any message group after extensively > researching this problem for days (not full time). > > I am trying to publish an artifact to Nexus from an ANT build occurring on > Hudson, and I generally follow the following steps in my ant build (I'm not > posting full versions unless requested): > > <ivy:settings id="snrm" file="${workspace.dir}/ivysettings.xml" > realm="Sonatype Nexus Repository Manager@sandbox"/> > <ivy:resolve /> > <ivy:buildnumber organisation="${ivy.organisation}" > module="ste-batch" > resolver="SPE-snapshots" > default="1.0.0" > revSep="."/> > > By this time, ${ivy.new.revision} has advanced to 1.0.1, and I *manually* > set a property called ${revision-number} to that new number. > > Then, I have ANY copy the existing jar (ste-batch.jar) to a file named > (ste-batch-1.0.1.jar), because 1.0.0 exists in Nexus already (which works > perfectly ok when publishing something that has never existed before---I > expect that because I state the default revision to be 1.0.0 explicitly) > > All of this works as expected up until here. > > When I perform the publish: > > <ivy:publish revision="${revision-number}" resolver="SPE-snapshots" > update="true" settingsRef="snrm" publishIvy="true"> > <artifacts pattern="workspace/[artifact].[ext]" /> > <artifacts > pattern="workspace/STE/work/assemble/[artifact]-[revision].[ext]" /> > <artifacts > pattern="workspace/STE/components/batch/work/assemble/[artifact]-[revision].[ext]" > /> > </ivy:publish> > > ANT fails with the following error: > > /home/hudson/.hudson/jobs/Publish-TEST/workspace/build.xml:120: > spe#ste-batch;1.0.2: > java.lang.IllegalStateException: ivy file not found in cache for > spe#ste-batch;1.0.2: > > please resolve dependencies before delivering > (/home/hudson/.ivy2/cache/resolved-spe-ste-batch-1.0.2.xml) > > > The file > > /home/hudson/.ivy2/cache/resolved-spe-ste-batch-1.0.2.xml > > is never created, and from my research, this occurs because I am trying to > publish a file, with the name apps-standard-batch-1.0.2.xml, that had not > been resolved yet. However, that confuses me because it is the artifact I am > trying to build, not some dependency I am trying to resolve. > > The suggestion I thought might closest help me resolve this issue seems to > express the idea that I need to perform a resolve again after the new file > has been created. However, I have tried that (and it doesn't do anything at > all, as expected), but I don't know how or why that would work unless the > new revision was somehow represented in my ivy.xml file, which it isn't, and > anyway, I'm trying to not put custom revision numbers in my ivy.xml file > regardless. > > I expect I am missing something elementary here, but would love to hear any > suggestions or comments. I can provide more complete examples of the > ivysettings.xml, ivy.xml, build.xml files as requested. > > Thanks very much in advance, > Shaka Tardimurthy >