ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From limbicsystem <limbicsys...@gmail.com>
Subject "extra" attributes lost when dependencies are placed into cache
Date Wed, 23 Jan 2008 22:51:51 GMT

Hi,

I'm making use of the "extra" attributes in <dependency> in order to lay out
staging directories for my artifacts.  For example, I have a project that
generates an ear file.  It needs to place its dependencies in particular
subdirs in the ear; some dependencies go in "APP-INF/lib", others go in
"services".  I accomplish this by setting a target.dir attribute in my ear
project's dependencies, like so:

   <dependency rev="${myapp.version}"
               name="some-lib"
               org="my-company"
               conf="compile->default;runtime->default"
               target.dir="APP-INF/lib"/>

   <dependency rev="${myapp.version}"
               name="another-lib"
               org="my-company"
               conf="compile->default;runtime->default"
               target.dir="services"/>

Then I use ivy:retrieve to place my deps in the proper layout in my staging
area:

        <ivy:retrieve validate="false" organisation="${org}"
module="${ant.project.name}"
                      useOrigin="true"
                     
pattern="${staging.dir}/[conf]/([target.dir]/)[artifact].[ext]"
sync="false"/>


This works fine- I get a dir that looks like:

                      staging.dir/runtime/APP-INF/lib/some-lib.jar
                      staging.dir/runtime/services/another-lib.jar

However, the "target.dir" attribute only seems to take effect when my ivy
cache is empty- the initial retrieve works as expected, but subsequent
retrieves seem to ignore target.dir, as if it were undefined for each dep. 
All my deps end up in staging.dir/runtime.  If I do a cleancache, retrieve
works properly again.

I suspect that what is happening is when my dependencies' metadata gets
placed into the Ivy cache, it does not have any target.dir attributes (this
is logical, since these are defined in the ear project, not the
dependencies' ivy.xmls).  But when these artifacts are then found in the
cache, "target.dir" is undefined, and this somehow causes its value to be
disregarded in my ear's ivy.xml.  

I'm using Ivy 2.0.0-beta2-local-20080103173107.  Thanks in advance for your
time.




-- 
View this message in context: http://www.nabble.com/%22extra%22-attributes-lost-when-dependencies-are-placed-into-cache-tp15054739p15054739.html
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message