ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Brauer <jan.bra...@coremedia.com>
Subject Re: Having a hard time with publications and their configurations
Date Thu, 01 Nov 2007 13:52:27 GMT
Xavier Hanin wrote:
> On 11/1/07, Jan Brauer <jan.brauer@coremedia.com> wrote:
>> Xavier Hanin wrote:
>>> On 10/31/07, Jan Brauer <jan.brauer@coremedia.com> wrote:
>>>> I'm trying to figure out how the configurations mechanism works
>> combined
>>>> with the publications feature.
>>>>
>>>> I'm using these configurations in every module i defined.
>>>>
>>>> <configurations defaultconfmapping="compile->default"
>>>> confmappingoverride="false">
>>>>   <conf name="compile" visibility="private"/>
>>>>   <conf name="test" extends="compile" visibility="private"/>
>>>>   <conf name="master"/>
>>>>   <conf name="runtime" extends="compile"/>
>>>>   <conf name="default" extends="master,runtime"/>
>>>> </configurations>
>>>>
>>>> This is my module ivy.xml:
>>>>
>>>> <ivy-module version="1.3">
>>>>   <info organisation="firma" module="firma-webapp"/>
>>>>
>>>>   <configurations>
>>>>     <include file="${basedir}/../tools/etc/ivy/configurations.xml"/>
>>>>   </configurations>
>>>>
>>>>   <publications>
>>>>     <artifact conf="master"/>
>>>>   </publications>
>>>>
>>>>   <dependencies>
>>>>     <!-- original jars -->
>>>>     <dependency org="commons-logging" name="commons-logging" rev="1.0.4
>> "/>
>>>>     <dependency org="javax.activation" name="activation" rev="1.0.2"/>
>>>>     <dependency org="javax.servlet" name="servlet-api" rev="2.3"/>
>>>>     <dependency org="org.springframework" name="spring"
>>>> rev="${version.spring}" conf=""/>
>>>>     <dependency org="tomcat" name="jsp-api" rev="5.0.16"/>
>>>>
>>>>     <!-- Strange constructs -->
>>>>     <dependency org="javadoc" name="javadoc" rev="1.3"/>
>>>>     <!-- firma modules -->
>>>>     <dependency org="firma" name="spring" rev="latest.integration"
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>     <dependency org="firma" name="common" rev="latest.integration"
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>     <dependency org="firma" name="firma-base" rev="latest.integration"
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>     <dependency org="firma" name="firma-client" rev="latest.integration
>> "
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>     <dependency org="firma" name="firma-api" rev="latest.integration"
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>     <dependency org="firma" name="firma-server" rev="latest.integration
>> "
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>   </dependencies>
>>>> </ivy-module>
>>>>
>>>> This is the ivy.xml for the module I'm depending on:
>>>>
>>>> <ivy-module version="1.3">
>>>>   <info organisation="firma" module="firma-base"/>
>>>>   <!--
>>>>   <library vendor="sun" name="javawebstart" includes="*"/>
>>>>   -->
>>>>
>>>>   <configurations>
>>>>     <include file="${basedir}/../tools/etc/ivy/configurations.xml"/>
>>>>   </configurations>
>>>>
>>>>   <publications>
>>>>     <artifact conf="master,default" name="firma-base"/>
>>>>     <artifact conf="default" name="firma-services"/>
>>>>     <artifact conf="default" name="firma-version"/>
>>>>     <artifact conf="default" name="EventLog" type="dll"/>
>>>>   </publications>
>>>>
>>>>   <dependencies>
>>>>     ...
>>>>   </dependencies>
>>>> </ivy-module>
>>>>
>>>> When I do a <ivy:retrieve conf="runtime"/> after resolving the
>>>> dependencies for the firma-webapp, I always get four files instead of
>>>> one, as I would have expected by explicitly defining:
>>>> <dependency org="firma" name="firma-base" rev="latest.integration"
>>>> changing="true" transitive="false"
>>>> conf="compile->default;runtime->master"/>
>>>>
>>>> Whats wrong here or what am I missing?
>>>
>>> If I understand correctly you're surprised about getting the four
>> artifacts
>>> from firma-base while you'd expect to have only one: the only one
>> belonging
>>> to the master conf in your firma-base module. Is that right? If that's
>> what
>>> you expect I think your expectation are right (according to what I see
>> from
>>> the files except you provide). So what's going wrong? The first thing I
>>> would do is clean the Ivy cache to make sure you don't get a bad module
>>> metadata in the way. If you still have the problem I would try with
>>> something more simple, like for example make your firma-webapp depend
>> only
>>> on firma-base and not all other dependencies. Then if you still have the
>>> problem open a JIRA issue providing your Ivy version, ivy files involved
>>> (should be only two, firma-webapp and firma-base), your ivy settings,
>> and
>>> the debug log of your resolution process.
>> Exactly. I don't know what I did, but I have it working now. I think it
>> was a circular dependency in combination with the defaultmappig.
>> A next thing that doesn't seem to work is setting a <dependencies
>> defaultconf="webapp->master">. The defaultconf is always ignored. Is
>> this because I have a defaultconfmapping in my configurations?
> 
> 
> Indeed defaultconfmapping takes precedence over defaultconf.
> 
> Xavier
> 
> Jan
>>
> 
> 

So there's no way to define a "top level" defaultconfmapping and
override/add defaultconfs on module level? Not being able to use
defaultconf leads to very explicit dependencies.

Mime
View raw message