Is there a way to prioritize fragment dependencies?

274 views Asked by At

Is there a way to prioritize fragment dependencies? I have the case that one of the maven plugins that is used at compile time does not use the hierarchical OSGi Classloading, but instead uses a "flat" classpath. Now there is a version conflict between (transitive) dependencies of the host plugin and the fragment. Everything would work fine in a hierarchical scneario, but fails for the "flat" classpath.

Is there a way to prioritize the fragments dependencies? Logically, i mean that the dependencies of the fragment should be resolved before the dependencies of the host.

1

There are 1 answers

6
Neil Bartlett On

No, dependencies of the host and fragment are resolved at the same time. Besides, I'm struggling to imagine why you think it would ever help to resolve the fragment first.

I think you are jumping ahead of yourself. It seems you have decided that the solution must be based on resolution order, so that's the question you have chosen to ask. It would be much more helpful to go back a step (or several) and describe the actual error and why it's happening. All you've said so far is that something "fails"... in what sense? Is there an error message? Did something unexpected happen? Maybe your expectation is wrong, so please describe what you expected to happen vs what actually happened.

I'm also confused about your use of the terms "hierarchical" vs "flat" classpaths. OSGi classloading is neither strictly hierarchical nor flat.