ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: Help with publish
Date Thu, 30 Jun 2011 21:39:03 GMT
Could you try adding the srcivypattern attribute to your ivy:publish task and make it point
to your ivy.xml file?

Maarten



________________________________
From: Shaka Tard <shakatard@gmail.com>
To: ivy-user@ant.apache.org
Sent: Thursday, June 30, 2011 1:14 AM
Subject: Help with publish

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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message