I have defined version 4.3 in the parent pom for a library A , but in the project module specified by the child pom , version 2.5 of A is required. The issue I am facing is that both the versions are being kept and hence I am getting conflicts.
Please advise how to resolve the issue.
In general, it is recommended to have only one version of dependency in your classpath at a given time. Doing in such a way will allow you to know exactly what version of class will be used at runtime.
To avoid version conflicts try to specify your dependency like this:
Where you need to specify the
groupIdandartifactIdof your conflicting artifact with version 2.5.