Reputation: 1283
I am currently using Intellij Idea 2020.2.4.
I want to replace a dependency with a newer version of itself. I replaced
<dependency>
<groupId>com.company.digital.fmk</groupId>
<artifactId>dgt-security</artifactId>
<version>2.6.24</version>
</dependency>
with
<dependency>
<groupId>com.company.digital.fmk</groupId>
<artifactId>dgt-security</artifactId>
<version>3.9.0</version>
</dependency>
I've checked that in the effective pom, the version has changed to the new value. However, after running
mvn -U clean install
, when I click on a class from the dependency, it still shows the old version.
When I try to delete the old version from the project structure, it says that it is still used in a module, even though I can't find the old version number anywhere in the project.
I can't manually delete the old library from my local folder, because it is used in another project.
Other answers have suggested using Maven -> Reimport, but I didn't find this in my intellij
What can I do to make intellij use the new dependency version in my project ?
EDIT
When I right-click on a project and select Maven, here are my options:
Upvotes: 2
Views: 7370
Reputation: 26
You can go to your Maven repository: .m2/com/company/digital/fmk Delete jar files Rerun command, it will download dependencies again.
Upvotes: 1
Reputation: 12367
Right click on project -> maven -> sync shall do the trick previous versions did this by default on changes in pom.xml now it seems to be not available anymore
Upvotes: 1