ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Carlton" <Carlton.Br...@compucredit.com>
Subject Unexpected behavior regarding relative paths in <ivy:deliver> - bug?
Date Tue, 12 Feb 2008 21:33:18 GMT
I think I may have found a bug, can someone confirm this behavior for
me:

 

It seems that the <deliver> functionality treats relative paths in an
unexpected way.   In the deliverpattern attribute, it appears that paths
are resolved relative to the ${user.dir} system property.  This is
different from the usual Ant behavior of resolving them relative to
${basedir}.   I will describe the steps to reproduce below.

 

In a directory called parent I have an Ant script build-parent.xml
containing this line:

<ant dir="child-dir" antfile="build-child.xml" target="publish"/>

 

Of particular interest is the "dir" attribute, which sets the value of
the property ${basedir} in build-child.xml to child-dir.

 

In the build-child.xml, I have this target:

<target name="publish">

            <ivy:deliver

            deliverpattern="output/jar/[artifact].[ext]"

            settingsRef="module-settings"/>

</target>

 

The expected behavior is for the ivy file to be delivered to
child-dir/output/jar.   This succeeds when I run the publish target
directly from within build-child.xml.   However, it misbehaves when it
is called via <ant> from build-parent.xml.    The ivy file is delivered
to parent-dir/output/jar instead of child-dir.

 

A workaround is to use absolute paths in the deliverpattern attribute by
employing the ${basedir} property, like this:

<target name="publish">

            <ivy:deliver

            deliverpattern="${basedir}/output/jar/[artifact].[ext]"

            settingsRef="module-settings"/>

</target>

 

This makes the task work as I intend for both tests.   However, this
shows that Ivy is not treating relative paths as they are normally
treated in Ant, at least in the case of <deliver>.    This is also true
of the implicit deliver that happens in <publish>, the same behavior
occurs there.

 

Can someone confirm whether this is a bug?

 

Thanks,

Carlton




-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message