ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Piper" <>
Subject RE: How to get sources for transitive dependencies with IvyDE
Date Sun, 23 Aug 2009 22:21:04 GMT
I have tried blowing away the org.apache.myfaces.tomahawk and commons-validator directories
in my local cache just to make sure that they weren't artifacts of an older version of Ivy,
but it still generates the following dependency element for commons-validator (or any other
dependency with source artifacts for that matter):

<dependency org="commons-validator" name="commons-validator" rev="1.3.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>

The IVY-325 issue seems to suggest that transitive sources resolution is not expected to work.
 I've also just noticed (I should've done a
JIRA search to begin with).  Having said that, it's curious that you get transitive resolution,
Nicolas.  Through what configuration (in your settings file) do you get on-the-fly POM conversion?
By not declaring a local cache resolver? Also, I wouldn't have expected that you'd get sources
with 'default->default' as your conf attribute for the tomahawk dependency.



-----Original Message-----
From: Nicolas Lalevée [] 
Sent: Saturday, 22 August 2009 3:49 a.m.
Subject: Re: How to get sources for transitive dependencies with IvyDE

On Monday 17 August 2009 01:03:43 Ben Piper wrote:
> This is the relevant subset of my ivy.xml file.
>     <configurations>
>       <conf name="core"/>
>       <conf name="war"/>
>     </configurations>
>     <dependencies>
>       <dependency org="org.apache.myfaces.tomahawk" name="tomahawk"
> rev="1.1.6" conf="core->default,sources; war->default"> <exclude
> org="javax.servlet" name="jstl" />
>       </dependency>
>     </dependencies>
> The 'core' config is used for the Eclipse classpath.  This is the relevant
> subset of the Ivy report for the whole ivy.xml file.  Sensitive (but not
> relevant) information has been X'ed out.  As I indicated, there's no
> question that the commons-validator source artifact will be retrieved if
> the sources conf is specified for it... it just isn't transitively applied
> as you can see from the report xml.  The ivy.xml for tomahawk is just the
> default that is generated by Ivy when resolving a module from a Maven 2
> repo ( in this case).
>                 <module organisation="org.apache.myfaces.tomahawk"
> name="tomahawk" > <revision name="1.1.6" status="release"
> pubdate="20070613210225" resolver="external-repo"
> artresolver="external-repo" homepage="" downloaded="false" searched="false"
> default="false" conf="default, compile, runtime, master, sources"
> position="4"> <metadata-artifact status="no" details="" size="7626"
> time="0" location="C:\Documents and
> Settings\benp\.ivy2\cache\org.apache.myfaces.tomahawk\tomahawk\ivy-1.1.6.xm
>l" searched="false" origin-is-local="false"
> origin-location="http://ifcsbuilder:80
> 60/artifactory/external-public-repo/org/apache/myfaces/tomahawk/tomahawk/1.
>1.6/tomahawk-1.1.6.pom"/> <caller organisation="XXX" name="XXXX" conf="core"
> rev="1.1.6" rev-constraint-default="1.1.6" rev-constraint-dynamic="1.1.6"
> callerrev="X.X.X"/> <artifacts>
>                                         <artifact name="tomahawk"
> type="source" ext="jar" extra-classifier="sources" status="no" details=""
> size="2825626" time="0" location="C:\Documents and
> Settings\benp\.ivy2\cache\org.apache.myfaces.tomahawk\tomahawk\sources\toma
>hawk-1.1.6-so urces.jar">
>                                                 <origin-location
> is-local="false"
> location="http://ifcsbuilder:8060/artifactory/external-public-repo/org/apac
>he/myfaces/tomahawk/tomahawk/1.1.6/tomahawk-1.1.6-sources.jar"/> </artifact>
>                                         <artifact name="tomahawk"
> type="jar" ext="jar" status="no" details="" size="2941389" time="0"
> location="C:\Documents and
> Settings\benp\.ivy2\cache\org.apache.myfaces.tomahawk\tomahawk\jars\tomahaw
>k-1.1.6.jar"> <origin-location is-local="false"
> location="http://ifcsbuilder:8060/artifactory/external-public-repo/org/apac
>he/myfaces/tomahawk/tomahawk/1.1.6/tomahawk-1.1.6.jar"/> </artifact>
>                                 </artifacts>
>                         </revision>
>                 </module>
>                 <module organisation="commons-validator"
> name="commons-validator" > <revision name="1.3.1" status="release"
> pubdate="20061202152731" resolver="external-repo"
> artresolver="external-repo"
> homepage="${pom.artifactId.substring(8)}/
>" downloaded="false" searched="false" default="false" conf="co mpile,
> master(*), runtime, compile(*), runtime(*), master" position="5"> <license
> name="The Apache Software License, Version 2.0" url="/LICENSE.txt"/>
> <metadata-artifact status="no" details="" size="3708" time="0"
> location="C:\Documents and
> Settings\benp\.ivy2\cache\commons-validator\commons-validator\ivy-1.3.1.xml
>" searched="false" origin-is-local="false"
> origin-location="http://ifcsbuilder:806
> 0/artifactory/external-public-repo/commons-validator/commons-validator/1.3.
>1/commons-validator-1.3.1.pom"/> <caller
> organisation="org.apache.myfaces.tomahawk" name="tomahawk" conf="default,
> compile, runtime, master" rev="1.3.1" rev-constraint-default="1.3.1"
> rev-constraint-dynamic="1.3.1" callerrev="1.1.6"/> <artifacts>
>                                         <artifact name="commons-validator"
> type="jar" ext="jar" status="no" details="" size="138956" time="0"
> location="C:\Documents and
> Settings\benp\.ivy2\cache\commons-validator\commons-validator\jars\commons-
>validator-1.3.1.jar"> <origin-location is-local="false"
> location="http://ifcsbuilder:8060/artifactory/external-public-repo/commons-
>validator/commons-validator/1.3.1/commons-validator-1.3.1.jar"/> </artifact>
>                                 </artifacts>
>                         </revision>
>                 </module>
> -----Original Message-----
> From: Daniel Becheanu []
> Sent: Saturday, 15 August 2009 8:19 p.m.
> To:
> Subject: Re: How to get sources for transitive dependencies with IvyDE
> Can you give provide a library which you are trying to pull and you
> don't get sources?
> Also your ivyconf/ivy.xml will be nice.
> Daniel
> On Wed, Aug 12, 2009 at 12:46 AM, Ben Piper<> wrote:
> > Hi all,
> >
> > I'm using these Eclipse plug-in versions:
> >
> > Apache Ivy            2.1.0.cr2_20090704004254
> > Apache IvyDE
> >
> > and I'm wondering if it's possible to get sources for transitive
> > dependencies without having to declare them explicitly.  It seems that
> > because ivy.xml files generated from Maven 2 pom.xml's don't include
> > sources in the list of confs for transitive dependencies, there's no way
> > I can indirectly ask for them.  Or is there some specific way of
> > specifying the conf attribute (or some other attribute) for a parent
> > dependency so that it will force the sources conf on those transitive
> > dependencies?
> >
> > Obviously if I sneakily add a sources->sources(*) entry for a given
> > transitive dependency to the parent dependency's ivy.xml file in my
> > local cache, IvyDE will end up retrieving the sources JAR for that
> > transitive dependency (assume it exists in this case), but that's not a
> > solution, and I wonder if Ivy shouldn't be doing that (and adding one
> > for javadoc) by default? Although I suppose it can't guarantee that
> > source and javadoc artifacts actually exist, which I assume would cause
> > a resolve error (even though the parent artifact may have a
> > source/javadoc artifact).  Perhaps I've answered my own question.
> >
> > It's not a major issue for me, but I'd like to avoid explicitly
> > declaring transitive dependencies just to get their source artifacts if
> > at all possible.

Yep you shouldn't and it should work correctly.
And I have created a very simple project in Eclipse with only that dependency:
        <dependency org="org.apache.myfaces.tomahawk" name="tomahawk" 
rev="1.1.6" conf="default->default">
             <exclude org="javax.servlet" name="jstl" />
And I got the sources of every dependency, including the one of 

The only difference between your config and mine is that I hit directly a 
maven repository, and you are using some ivy files generated from a maven 
repo. In my config, the ivy file generation is done too but on the fly. So 
probably that at the time you generated that ivy files, you used an older 
version that was not capable of declaring the sources or the javadoc, before 
Ivy 2.0-RC1 [1] ?



View raw message