Answer the question
In order to leave comments, you need to log in
How to get rid of dependency conflict in maven?
Situation:
Application A depends on two libraries B (version 1.4) and C (version 1.0.3). In turn, C also uses the B library (version 1.3).
There is no complete backward compatibility between versions 1.3 and 1.4.
Because of this, after the transition of application A to use library B version 1.4, the application began to crash at Runtime. The error occurs in the C library (swears that the required class is missing).
Two questions:
1) Why does library C use version 1.4 of library B, although it has version 1.3 in its pom.xml dependencies?
2) How, besides rolling back the version of library B to 1.3, fix application A?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Maven Optional Dependencies and Dependency Exclusions
In general, this probably won't help you, you can try to deceive maven.
Do as it is written on the link that I gave, remove version 1.3
<dependency>
<groupId>библиотека С</groupId>
<artifactId>её имя</artifactId>
<version>версия</version>
<exclusions>
<exclusion>
<groupId>библиотека</groupId>
<artifactId>её id</artifactId>
</exclusion>
</dependency>
mvn install:install-file -Dfile=toster.jar
-DgroupId=ru.toster -DartifactId=toster-api -Dversion=0.0.1
-Dpackaging=jar
<dependency>
<groupId>ru.toster</groupId>
<artifactId>toster-api</artifactId>
<version>0.0.1</version>
</dependency>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question