ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Hein <tra...@thinkingphones.com>
Subject Re: how to publish and retreive multiple artifacts.
Date Mon, 15 Mar 2010 18:42:20 GMT
Ok, finally getting around to looking into this.

YES!, that was exactly what was happening. Ivy was delivering the 
default ivy.xml in my local lib/ folder.

I was trying to take an existing scratchpad folder of a bunch of lib 
.jar files and import them into a local ivy repository, so that all the 
other java modules would be able to resolve and retrieve from this, 
instead of needing to have the ${common-lib}  folder set up in each ant 
build.xml file.. And in my firs niave approach, I was just creating 
file1.ivy.xml  file2.ivy.xml  in the same lib/ folder, where there was 
file1.jar, file2.jar and so on.

And i didn't expect Ivy to create that lib/ivy.xml in the local lib/ 
folder after publishing to the local repository (I mean, i do want the 
ivy.xml and .jar file in the repository, but not really in the local 
lib/ folder; I have hand generated the ivy.xml file, as file.ivy.xml and 
so on.)

So to work around this, I have just reorganized my scratchpad folder to 
contain
   file1/
     ivy.xml
     lib/
       file1.jar
   file2/
     ivy.xml
     lib/
       file2.jar

and so with these nested folders, while it is likely horribly inelegant, 
and likely a better way to do this, for now, the delivered ivy.xml goes 
into the local lib/ folder (that i have no use for in this current 
approach), and by having it created out of the way, all the wonderful 
ivy features now work.!


On 03/08/2010 04:52 PM, Maarten Coene wrote:
> Does your repository also contains the ivy.xml file of your logback module?
> If not, Ivy will create a default one containing a single publication artifact.
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: Travis<travis62@travnet.org>
> To: ivy-user@ant.apache.org
> Sent: Mon, March 8, 2010 3:29:44 PM
> Subject: how to publish and retreive multiple artifacts.
>
> I am trying to set up a local repository where I publish a module that has more than
one .jar file artifact, and then later retrieve the artifacts.
>
> So far it would appear publish into the local repository is working, I do see all of
the artifacts making it into
> the local repository folder.
>
> The problem is when I try to resolve the module it appears only the first artifact file
is getting resolved, not the other ones.
>
> using ivy 2.1.0 on ant 1.7.1
>
> The ivy file in the module I am trying to stuff into the local repository. I just created
one for the logback module, but the idea where i wouldhave a module  (e.g. logback) and more
than one jar file for api and implementation pieces (e.g. -core,  -classic).
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
> <info
>          organisation="qos.ch"
>          module="logback"
>          revision="0.9.18"
>          status="integration"
>          publication="20091203221300">
> </info>
> <publications>
> <artifact name="logback-core"/>
> <artifact name="logback-classic"/>
> </publications>
> </ivy-module>
>
>
> where publishing is done in an ant task with
> <ivy:resolve file="${file}"/>
> <ivy:publish
>          resolver="internal"
>          update="true"
>          overwrite="true"
>          publishivy="false"
>          organisation="${org}"
>          module="${module}"/>
>
> So in the following jar files exist in the local repository folder after publishing:
>
> logback-core-0.9.18.jar
> logback-classic-0.9.18.jar
>
> [ivy:publish] :: publishing :: qos.ch#logback
> [ivy:publish]   published logback-classic to /home/thein/.ivy2/local/qos.ch/logback/logback-classic-0.9.18.jar
> [ivy:publish]   published logback-core to /home/thein/.ivy2/local/qos.ch/logback/logback-core-0.9.18.jar
>
>
> And then in the module where I want to resolve it, the ivy.xml dependencies
> <dependencies>
> <dependency org="qos.ch"  name="logback" rev="latest.integration"/>
> </dependencies>
>
>
> And the build.xml uses the default ivy resolve so far.
> <ivy:resolve/>
> <ivy:retrieve/>
>
> And this does resolve the logback-core  jar file, but not the logback-classic jar file.
>
> At first I had thought this was because the -core jar was the first artifact. But when
I reorder the artifacts list, and clean out the cache and local repository and re-publish,
re-resolve, It still unexpectedly only fetches the -core one.
>
> <publications>
> <artifact name="logback-classic"/>
> <artifact name="logback-core"/>
> </publications>
>
>
> So, am I doing it wrong to try to use a single ivy.xml file to define a 'module' that
has more than one jar file (e.g. within the same configuration) to all be resolved at the
same time. ?
>
>
>
>    


Mime
View raw message