It has a Maven project, where pom has dependencies:

<dependency> <groupId>ru.company</groupId> <artifactId>jpos</artifactId> <version>1.4.8.2</version> </dependency> <dependency> <groupId>org.jpos</groupId> <artifactId>jpos</artifactId> <version>1.9.0</version> </dependency> 

I need to use methods from org.jpos.iso.ISOMsg so it happened that the ru.company package includes org.jpos like on a picture

if I specify only ru.company in pom , then everything works as it should, but I also need another package. How would I solve this problem?

ps since one package includes another, you can use this particular package. but I would like to get an answer how to be in this situation

  • Google Dependency Exclusions maven, looks like what you need? - MrFylypenko
  • @MrFylypenko yes, suitable. thank. - Senior Pomidor

1 answer 1

You can exclude using Maven Dependency Exclusions , something like this:

  <dependency> <groupId>ru.company</groupId> <artifactId>jpos</artifactId> <version>1.4.8.2</version> <exclusions> <exclusion> <groupId>org.jpos</groupId> <artifactId>jpos</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.jpos</groupId> <artifactId>jpos</artifactId> <version>1.9.0</version> </dependency>