When I change a dependency version in one of the pom.xml of my project (which has several modules) I see the new version and also the old one in the Libraries section of the Project Structure.
For example, recently I changed Drools from version 5.4 to 5.5. When I entered the Libraries section I saw both libraries so I manually removed the 5.4.
How can I tell IDEA to remove libraries that are not referenced in the pom.xml files?
Thank you
If the dependencies weren't imported correctly (IntelliJ IDEA highlights them), try to perform the following actions: You can check your local maven repository in the Maven | Repositories settings and try to update it. You can check the jar file of the local . m2 repository to see if it was downloaded correctly.
Well, this is not problem with synchronize project libraries.
The synchronization settings can be set via Settings > Maven > Importing > Import maven project automatically
But I think this is other problem. It is caused by other dependency which uses different Drools version. You have to exclude the old Drools version from that dependency explicitly.
How to find this problem causing dependency?
Open your dependency tree. It can be done via right click
on your maven module and click Show dependencies
or hit Ctrl + Alt + Shift + U.
There will be some red lines leading to different version of the same maven artifact. Just click on it and Idea will lead you where the inconsistency happened. Then just right click on maven artifact with wrong version and click Exlude
or Shift + delete.
Check your pom.xml
. You should find line like this:
<exclusions>
<exclusion>
<artifactId>drools</artifactId>
<groupId>drools</groupId>
<version>5.4</version>
</exclusion>
</exclusions>
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