You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Dan Hargreaves <Da...@graffica.co.uk> on 2014/07/17 17:49:41 UTC

Publishing and then resolving transitive dependencies

Hi All,

I'm really sorry if this is documented somewhere but I have searched and 
experimented and I cannot get anything working.

I have my library (A) being published to artifactory by Ivy through an 
ant script run by Jenkins, it depends on nothing.  I then have another 
software module (B) which depends on the latest.integration version of 
library A, it too is being published to artifactory by ivy and Jenkins.  
Then I have my final project, it should be able to depend on B and 
resolve the correct version of A.  I can depend on and resolve B but A 
never ends up on my classpath in my eclipse workspace.

I'm guessing that I need to use makepom, as when I include the ivy.xml 
file in the META-INF directory of my jar IvyDE fails to open it, so I'm 
guessing it's not used to looking in jars so my suspicion that I need a 
pom.  Is this correct?  Is it the pom inside the jar that is used to 
identify dependencies?

If it is, I have tried making a pom with the ant task, I've tried 
manually substituting latest.integration for the actual version that has 
been built against in the ivy.xml before calling makepom, I've tried 
specifying <mapping conf="*" scope="compile"/> and still module A will 
not be resolved, IvyDE is set to resolve transitive dependencies, I'm 
not using any configurations, everything is just defaulted to default...

I'm getting to the point where I'm struggling to see the difference 
between my pom and the one contained in guava, the only difference is 
that alongside guava in artifactory is a pom rather than an ivy file, I 
don't really want to use maven to publish my jars, there must be 
something I'm doing wrong with ivy?

Can someone please help

Thank you

Dan.

Re: Publishing and then resolving transitive dependencies

Posted by Ca...@gebit.de.
Hi Dan,

there are many reasons that could possibly be the cause for your problem, 
too many to 
list them all.

Could you post your ivy.xml files, your ivy settings and your resolve 
calls (or, in IvyDE,
the classpath container configuration)?

In IvyDE, have a look at the special lvy Console (in the console view, 
click the right-most
button in the toolbar and select "Ivy Console". In that console's toolbar 
you can increase
the output level to "Debug" or "Verbose", for example.

I'd also suggest cleaning or temporarily moving away your Ivy cache 
(typically ~/.ivy2/cache).
Maybe you have some old, broken content in there which prevents a new 
version being
pulled in.

Good luck
Carsten

Dan Hargreaves <Da...@graffica.co.uk> wrote on 21.07.2014 
17:50:41:

> Von: Dan Hargreaves <Da...@graffica.co.uk>
> An: Carsten.Pfeiffer@gebit.de, ivy-user-help@ant.apache.org
> Datum: 21.07.2014 18:55
> Betreff: Antwort: Publishing and then resolving transitive dependencies
> 
> 
> Carsten,
> 
> Thank you for your reply.  In my Artifactory repository I do have the 
> ivy.xml file sitting next to the published jars that I am depending on 
> but IvyDE doesn't seem to attempt to download the dependencies specified 

> in the ivy file...  I don't know what else I can try to get IvyDE to 
> pick it up.
> 
> In the repository I have
>      mymodule
>              0.1-SNAPSHOT
>                      myjar.jar
>                      ivy.xml
>      mydependency
>              0.2-SNAPSHOT
>                      dependency.jar
>                      ivy.xml
> 
> mymodule depends on mydependency and that is specified in the ivy.xml of 

> mymodule.  But when I resolve mymodule I never get mydependency 
> downloaded or even any messages about it in the console  :(
> 
> Thank you again for any suggestions
> 
> Dan.

Antwort: Publishing and then resolving transitive dependencies

Posted by Ca...@gebit.de.
Hi Dan,

Dan Hargreaves <Da...@graffica.co.uk> wrote on 17.07.2014 
17:49:41:

> I'm guessing that I need to use makepom, as when I include the ivy.xml 
> file in the META-INF directory of my jar IvyDE fails to open it, so I'm 
> guessing it's not used to looking in jars so my suspicion that I need a 
> pom.  Is this correct?  Is it the pom inside the jar that is used to 
> identify dependencies?

usually the poms and ivy.xml reside next to the jar instead of being part 
of the jar. With Ivy resolvers you specify an artifcat pattern (how to 
find the jars in the repository) and an ivy pattern (how to find the ivy 
files in the repository).

Best wishes
Carsten