Fork me on GitHub
#polylith
<
2022-02-03
>
Eugen12:02:28

what's the story in polylith with incompatible transitional dependencies. We have 2 components that depend on incompatible versions of apache jena. We are on Java 11 but not using java modules (which might also not help much since I don't think jdk modules use versions and the packages would be the same .. ?!)

tengstrand13:02:53

Let’s say we have two different components c1 and c2 which depend on different versions of the library x(let’s call them x1 and x2). Let’s say we also have two projects p1 and p2 that both contain c1 and c2 and that we want p1 to use x1 and p2 to use x2 . To solve this we need to manage the library dependencies at the project level and remove the dependency to x from c1 and c2 and instead add x as a project dependency, so that p1 depends on x1 and p2 depends on x2. For development we have to choose which version of the library to use.

Eugen13:02:40

thanks, yeah, makes sense - I guess aliases can be used to add libraries in the component

tengstrand13:02:56

If the two components are implementing the same interface, then you need profiles to handle that for the development project, otherwise profiles are not needed.

👍 1
seancorfield16:02:08

@U011NGC5FFY at work we have this exact situation with Jackson - one project has to have a different (older) version so we specify Jackson at the project level (including development, where we also use the older version so we can run the code that depends on it in the REPL).

👍 2