Hi Adrian,

I experienced the same behaviour. In my case, I had created a configuration
"ivy_only". The purpose of this configuration was to resolve and retrieve
published ivy-files. The resolved ivy-file was downloaded to my cache and
could be retrieved to another location. But when calling the
artifactproperty task,  the properties were not filled in. When I resolved
a configuration for which artifacts were published, the properties were
filled in as expected.

My workaround was to publish a dummy artifact with my configuration
ivy_only. When I then resolved that configuration, properties were filled
in as expected when calling artifactproperty.

Since the task is called "artifact"property, one could argue that this was
works as documented. However I also found it confusing. If you create a
change request for this, I will vote for it ;)

Regards,
Marc


2014-05-12 1:28 GMT+02:00 Adrian Howchin <adrian.howc...@ventyx.abb.com>:

> Hello,
>
> I have a problem with the Ivy artifactproperty task in Ant. I am using Ant
> version "Apache Ant(TM) version 1.8.3 compiled on July 31 2012" and Ivy
> version "2.2.0-local-20130509001717". I am running this on Linux.
>
> I am resolving an Ivy xml file with many dependencies. One of these
> dependencies is a virtual module (a module that has no artifacts, only
> dependencies). I am using the artifactproperty task to create properties in
> Ant so that I can refer to them later. The problem I have is that the
> virtual module does not get a property set, however all the artifacts do.
> When I try to echo the value, it comes back with:
> [echo] MYVIRTUALARTIFACT.version: ${MYVIRTUALARTIFACT.version}
>
> .. and:
> /tmp/build.xml:20: Property 'MYVIRTUALARTIFACT.version' is not defined.
>
> artifactproperty code below:
>       <ivy:artifactproperty conf="default"
>         name="[module].version"
>         value="[revision]"/>
>
> The virtual module conf and the conf in the artifact property match. I've
> tried creating another virtual module and accessing its property, but as
> with the other one it does not get a property set in Ant.
>
> I suspect that either the artifactproperty task does not create Ant
> properties for modules (only artifacts), or that modules have a different
> version property to artifacts. Reading this suggests that #1 might be the
> case:
> Sets an ant property for each dependency artifacts previously resolved.
> (From: http://ant.apache.org/ivy/history/2.1.0/use/artifactproperty.html)
>
> Can anyone confirm this for me? Is there a way around this, i.e. a flag I
> can set to get Ivy to create properties for modules as well as artifacts?
>
> Regards,
> Adrian
>

Reply via email to