OSGI causing conflict due to xalan multiple version coming from two different source

16 Views Asked by At

My maven plugin depend on another maven app, this app's versions <x.0.0 provides xalan v2.7.2 dependency implicitly, but versions >x.0.0 does not provide xalan. Since version >x.0.0 stopped providing xalan, i started including xalan v2.7.3 as dependency in my pom.xml as my plugin need xalan to work.

Now the problem is i have a structure like this -

if my plugin runs with app v>x.0.0, it works just fine as i have included xalan 2.7.3 dependency but if i remove xalan dependency from my plugin, it will stop working with app versions >x.0.0 as they do not provide xalan.

if my plugin runs with app v<x.0.0, it shows osgi type mismatch conflict as both v2.7.3 and 2.7.2 of xalan are present.

This is causing conflict at run time as osgi tries to cast type from one version to another. osgi at run time says "cannot be cast to org.apache.xml.dtm.DTMManager"

How do i resolve such conflicts with osgi? I want to be able to define "use xalan version v2.7.3 always in my plugin irrespective what all xalan versions are available", or "if xalan v2.7.2 is present, do not include dependency v2.7.3"

0

There are 0 best solutions below