I have a project in which a Maven project is deployed in two different ways using two groupId
s and different version
s. For example:
a) Depends on a branch (using jitpack):
<dependency>
<groupId>com.github.user</groupId>
<artifactId>myProj</artifactId>
<version>aaaaaa-SNAPSHOT</version>
</dependency>
b) Depends on a ... version (other source):
<dependency>
<groupId>org.user</groupId>
<artifactId>myProj</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
I am using method a). My project also depends on some other project which deploys method b). I don't know, how can I override the b) or how can I tell Maven that these are same project and ask them to use a).
This provides a way to use same project with different artefact names using classifier
. I also looked on Dependency Management but could not really understand. I am not an expert in this field.
With respect to Maven, the two dependencies are different and hence cannot be overridden.
But you can use exclusions
(detailed description in Optional Dependencies and Dependency Exclusions) to remove any transitive dependency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With