ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: publishing configurations
Date Wed, 11 Apr 2007 05:51:27 GMT
On 10-Apr-2007 17:19:04 EDT, Todd_Lee@amis.com <Todd_Lee@amis.com> wrote:
>
>
> Hi there,
>
> I'm fairly new to Ivy and trying to set up some projects with
> configurations. Here's a pseudo-example of my use case -
>
> Two projects A & B
>
> A has no dependencies (other than source)
> B depends on a binary artifact of A
>
> A generates a number of artifacts, each of which I'd like to specify for
> use with a configuration.
> A's output is generated such that I can nicely use subdirectories for
> config names
> i.e.-
>
> stage/
>        |-config1/artifact1.out
>        |-config2/artifact2.out
>        |...
>
> So in my ivy.xml file for A I have something like
>
>     <configurations>
>         <conf name="config1" description="provides artifact1" />
>     </configurations>
>     <publications>
>         <artifact name="artifact1" type="out" ext="out" conf="config1"/>
>     </publications>
>
> And in my ivy:publish for A's build.xml, I have:
>
>         <ivy:publish
>                 resolver="${ivy.resolver}"
>                 pubrevision="${build.revision}"
>                 srcivypattern="${ivy.project.dir}/ivy.xml"
>                 haltonmissing="false"
>                 forcedeliver="true" >
>                 <artifacts pattern="${stage.dir}/[conf]/[artifact].[ext]"
> />
>                 <artifacts pattern="${stage.dir}/[artifact].[ext]" />
>         </ivy:publish>
>
> note that I use the two artifact patterns because there are some artifacts
> in the root stage dir and some in the conf-specific sub-dirs...


The problem is that it can't work, because [conf] is not a token accepted
for artifacts pattern during publish. Indeed, an artifact can be published
in several configurations, so Ivy doesn't set conf token during publish.
Well, to be more precise, when Ivy doesn't know the conf token, it sets it
to "default". I agree this behavior can be considered as really strange, and
we should better raise an error or at least a warning. You can open a JIRA
issue for that.

So the solution is either to add as many artifacts pattern as you have
configurations (not really beautiful, I agree), or to put all your artifacts
in the same directory (your artifacts MUST be distinctable by something else
than conf anyway).

The same apply for your resolver patterns (you don't show here, but
according to what I see in the logs below it seems you use conf token in
your patterns). Do not  use conf pattern in your resolver patterns.

HTH,

Xavier

So when I run the build.xml, it seems as though it's only ever trying to
> publish the 'default' conf.
> i.e - following output...
>
>
> [ivy:configure] :: configuring :: file = C:\ivy\ivyconf.xml
>
> resolve:
> [ivy:retrieve] :: resolving dependencies :: [ org | mymod | 200704101655 ]
> [ivy:retrieve]  confs: [config1]
> [ivy:retrieve] :: resolution report ::
>
> ---------------------------------------------------------------------
>         |                  |            modules            ||   artifacts
> |
>         |       conf       | number| search|dwnlded|evicted||
> number|dwnlded|
>
> ---------------------------------------------------------------------
>         |      config1      |   0   |   0   |   0   |   0   ||   0   |   0
> |
>
> ---------------------------------------------------------------------
> [ivy:retrieve] :: retrieving :: [ org | mymod ]
> [ivy:retrieve]  confs: [config1]
> [ivy:retrieve]  0 artifacts copied, 0 already retrieved
>
> publish:
> [ivy:publish] :: publishing :: [ org | mymod ]
> [ivy:publish]   published artifact1 to
> C:/build_root/ivy/local-repository/org/mymod
> /200704101714/default/artifact1.out
>
>
> So it looks like the retrieve step knows about my conf's but publish just
> uses the default - is there something I'm missing??
> I'd like to be able to specify my dependency in B as something like:
>
>     <dependencies>
>         <dependency org="org" name="mymod" conf="default->config1"
> rev="latest.integration" />
>     </dependencies>
>
> but if it never gets published, I don't see how it's going to work...
>
> Any help is appreciated.
>
> thanks
> Todd
>
> AMI Semiconductor - "Silicon Solutions for the Real World"
> NOTICE:
> This electronic message contains information that may be confidential or
> privileged. The information is intended for the use of the individual or
> entity named above. If you are not the intended recipient, please be aware
> that any disclosure, copying, distribution or use of the contents of this
> information is prohibited. If you received this electronic message in error,
> please notify the sender and delete the copy you received.
>
>


-- 
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message