ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaikiran Pai <jaiki...@apache.org>
Subject Re: Force cache to apply namespace definitions
Date Fri, 05 Oct 2018 13:31:02 GMT
Hello Pedro,

Thank you for trying it. I also noticed that you commented on
https://issues.apache.org/jira/browse/IVY-877 which is a similar issue
but looking at that error, it might be slightly different. Would you
mind creating a JIRA for the issue you described in this mail, so that
it can be tracked separately?

-Jaikiran


On 05/10/18 5:59 PM, Pedro de Carvalho Gomes wrote:
> Hi Jaikiran,
>
> Thanks for the reply. I tried you suggestion, but it didn't work. I was
> already expecting it to fail because the issue happens within the system
> namespace.
>
> The problem occours because the namespace defintion wasn't in place when
> the dependency was first added to the local cache. By then, Ivy simply
> downloaded the POM and translated it to an ivy file, and both reference
> "org.jboss:javassist". But after the namespace rules are added, the cache
> isn't invalidated at any point. So, the wrong depedency remains.
>
> The only workaround I have found so far is to remove the cache entries that
> depend on incorrect org/names. When these are re-added to the cache, then
> Ivy will apply the namespace defintions to the dependencies, as expected.
>
> On Fri, Oct 5, 2018 at 9:19 AM Jaikiran Pai <jaikiran@apache.org> wrote:
>
>> Hello Pedro,
>>
>> Given that the Ivy cache uses the system namespace, would adding a
>> "fromsystem" in your namespace take care off this conversion. Something
>> like:
>>
>> <namespace name="fix-javassist">
>>           <rule>
>>               <fromsystem>
>>                   <src org="org.jboss" module="javassist"/>
>>                   <src org="javassist" module="javassist"/>
>>                   <dest org="org.javassist" module="javassist"/>
>>               </fromsystem>
>>               <tosystem>
>>                   <src org="org.jboss" module="javassist"/>
>>                   <src org="javassist" module="javassist"/>
>>                   <dest org="org.javassist" module="javassist" />
>>               </tosystem>
>>           </rule>
>>     </namespace>
>>
>>
>> I haven't given it a try, but from my understanding, the cached
>> reference (of org.jboss:javassist) which is in system namespace should
>> then get converted to org.javassist:javassist, with the above
>> configuration.
>>
>> Can you give that a try?
>>
>> -Jaikiran
>>
>>
>> On 04/10/18 3:32 PM, Pedro de Carvalho Gomes wrote:
>>> Hi all,
>>>
>>> My project downloads from a Maven respositories where different
>>> dependencies do not have consistent names. For instance, javassist has
>>> different ORG definitions:
>>> - org.jboss if version < 3.8
>>> - javassist if 3.8 <= version < 3.13
>>> - org.javassist if version >= 3.13
>>>
>>> I fix this inconsistency with namespaces by mapping all ORGs to the most
>>> recent:
>>>
>>> <namespace name="fix-javassist">
>>>           <rule>
>>>               <fromsystem/>
>>>               <tosystem>
>>>                   <src org="org.jboss" module="javassist"/>
>>>                   <src org="javassist" module="javassist"/>
>>>                   <dest org="org.javassist" module="javassist"/>
>>>               </tosystem>
>>>           </rule>
>>> </namespace>
>>>
>>> However cached dependencies do not see the new namespace definitions. For
>>> instance, a dependency that transitively depends on
>> org.jboss#javassist-3.5
>>> (as defined at its ivy-x.y.z.xml) won't map this to
>> org.javasist#javassist.
>>> Is there a way to force namespace rules for cached dependencies?
>>>
>>> Pedro
>>>
>>


Mime
View raw message