How to force intellij idea to reread/update all dependencies specified in the pom file ?
19 Answers
Press Ctrl+Shift+A to find actions, and input "reload", you will find the "Reload All Maven Projects".
On a Mac, use ⌘+⇧+A instead.
-
2Lets say I have 5 modules, all of them maven based, in a single project and I do this. Does this command apply to all modules, just the selected one, or the first one in the project when it runs? – slartibartfast Sep 25 '15 at 22:06
-
2has this changed? I do not see a reimport on 2017.1 in Maven – Winnemucca May 22 '17 at 17:08
-
1@Winnemucca I just did it on 2017.2. Waiting for it to finish now. – mrClean Aug 03 '17 at 16:49
-
1I had to enable Maven plugin to do this. – codefreak Feb 27 '18 at 04:22
-
1@Winnemucca you can right click on the pom, go to Maven in the drop down, and choose Reimport. – jones-chris Apr 01 '19 at 13:14
-
Original import took minutes, when doing this only take 1 sec, something seems wrong with the solution (or it's my setup which is clearly not impossible). – T.Nel Sep 25 '19 at 14:13
-
15At the time of this writing, it is now called "Reload all Maven Projects". – Da Mike Jul 16 '20 at 16:09
-
3Is this renamed to "reload all maven projects"? – Yuqing Dec 29 '20 at 18:59
-
Not very wise to give a shortcut that can change from a configuration to another. – pdem Jun 30 '21 at 08:37
-
This worked for me when IntelliJ refused to update an External Library artifact to the new version that I'd declared in my POM, and insisted the method I was trying to use didn't exist. But what I'd *really* like to know is *why* IntelliJ does this from time to time. It's incredibly obnoxious, and often makes me question my sanity. – Matt Aug 30 '22 at 13:43
Open the "Maven Projects" tab/window and clicking the "Reimport All Maven Projects" in the upper left corner starts to reload all dependencies from their repositories. The status bar informs about the process.
What lets you think that this is not working correctly? Maybe any of the dependencies can't be load from the repository?
-
1we have a broken habit of using a non-snapshot version for on-going development, and cross-project dependencies sometimes fail. – kubek2k Apr 02 '12 at 18:15
-
1I'm afraid this problem depends on maven. Maven only checks for updates on SNAPSHOTs. Per definition, non-SNAPSHOT versions will never change so maven don't has to check for newer versions than this in the local repository. A (quite rude) solution would be to remove the library from the local repository before invoke maven. Then it has to reload the library. – magomi Apr 02 '12 at 18:29
-
10it appears that the reimport all forces the -U flag what is what I wanted :) – kubek2k Apr 02 '12 at 18:34
-
I was right-clicking the parent project and doing Maven -> Reimport and hoped it'll update the dependencies of all the children, but it did not. Thanks for the solution! – botchniaque Nov 20 '14 at 10:21
-
8To find the "Maven Projects" tab/window go to View > Tool Windows > Maven Projects – Kevin Wheeler Mar 14 '15 at 17:00
-
It worked for me. Thank you a lot for that. I just had to reload all maven projects and my project has successfully returned to work. It has fixed the following errors: 1 - Fatal error compiling: invalid target release 2 - Unknown lifecycle phase “build”. You must specify a valid lifecycle phase or a goal in the format Again, thank you a lot. You contributed to stopping 6-7 hours of continuous research! – FARS May 23 '21 at 01:24
There is also one useful setting that tells IntelliJ to check for new versions of dependencies even if the version numbers didn't change. We had a local maven repository and a snapshot project that was updated a few times but the version numbers stood the same. The problem was that IntelliJ/Maven didn't update this project because of the fixed version number.
To enable checking for a changed dependency although the version number didn't change go to the "Maven Projects" tab, select "Maven settings" and there activate "Always update snapshots".

- 4,033
- 4
- 28
- 47
-
2ha! automated updates in a JAVA project...I'm going to have to say this one is NOT always a winner...and may even be frowned up w/ Maven 3+ – beauXjames Aug 18 '16 at 21:00
-
@beauXjames.. this didn't work for me but I am exactly facing the same issue. how to resolve this. – Sathesh Dec 06 '16 at 04:45
-
1I often go into the local repo ({user}\.m2\...) directory and delete those I know are associated with my project then let the install process go out and fetch them again from scratch so there's no version conflicts – beauXjames Dec 06 '16 at 17:13
-
1From `help`: "Select this checkbox, if you want IntelliJ IDEA to update snapshots on sync." In other words, it isn't fully automatic -- you have to `Synchronize` (in right-click menu or `Ctrl-Alt-Y`), but enabling this option causes it to grab updated `SNAPSHOT` versions. WARNING: There may be other subtleties involved, like `Import Changes` -- this doesn't seem to be perfectly reproducible for me so far. Maybe it was all in my imagination -- what does always seem to work is a full `reimport` as suggested in other answers. – Brent Bradburn Sep 25 '17 at 23:40
For IntelliJ IDEA 14.0
Project > [your project name] > right click > Maven > Reimport

- 2,353
- 2
- 27
- 36

- 807
- 11
- 13
-
2Thanks for this comment. I see too few answers on this post that contain the word "Reload", which in this case seems to do the same thing as what I guess "Reimport" used to do. – Jonathan May 24 '21 at 14:26
In the latest IntelliJ IDEA version (2020.1.3 Ultimate Edition), You need to to click this little guy that appears on the top right of the editor window after you make a change to the pom.xml
This little guy is too small and in an unnoticeable position. I liked the previous versions where an alert shows up in the bottom right. Still can't find the option to enable auto import in this version.
Another Option
From the properties panel on the right, select Maven and click on the reload icon. If you do not see maven on right panel, open it from View > Tool Windows > Maven

- 7,326
- 14
- 70
- 104
-
1Thank you for this answer !!! I feel dumb for admitting that before your hint, I was basically always shutting down my entire project and re-opening it !!! – Bram Luyten Feb 06 '21 at 14:25
-
1This little guy is so small that I clicked on the close btn instead and don't know how to reopen it 0.0 – BabyishTank Jan 28 '22 at 18:23
-
If you are using Gradle, you will find a Gradle Menu Option on the right top corner above Notifications Menu Option. Then click on the first Refres like Menu Option (Reload All Gradle Projects.) – Raj Kanchan Aug 29 '22 at 17:50
run this command
mvn -U clean install

- 671
- 6
- 18
-
3While this is a solution, it needs to be done from the CLI. The question is about doing it from inside IDEA. – talonx Jun 19 '18 at 08:46
-
3on the IDE, you can execute a maven goal and use the command above without you opening your CLI or Terminal – Babajide Apata Jun 19 '18 at 08:56
-
2
-
3We are talking about the -U option, which is not present in IDEA. The "Reimport" option sounds like it is, but it's not. – talonx Jun 19 '18 at 10:43
-
it is present, the intellisense should even show you the description of what -U does – Babajide Apata Jun 19 '18 at 11:00
-
1I see that you are referring to typing and executing a maven goal, in which case it's possible. However, I was referring to -U not being present in the built-in menu on the right ("Maven Projects"). – talonx Jun 19 '18 at 11:15
If the reimport does not work (i.e. doesn't remove old versions of dependencies after a pom update), there is one more chance:
- open the project settings (CTRL+SHIFT+ALT+S)
- on modules, delete all libs that you want to reimport (e.g. duplicates)
- IDEA will warn that some are still used, confirm
- Apply and select OK
- then reimport all maven projects.

- 113,398
- 19
- 180
- 268
-
Thanks, this works, although now the library doesn't show up under "External Libraries" at all, but the project is using the new library successfully anyway. I wonder what is wrong with IntelliJ when it can't update the External Libraries section to match the reality. – Jenneth Apr 07 '21 at 11:16
Setting > Maven > Always update snapshots

- 1,205
- 14
- 16
-
1
-
2Only this option works for me to force Maven to download the latest JAR from a remote source instead of using the one in the local .m2 repo – dfche Aug 19 '21 at 14:56
-
This should be the prerequisite to other answer with "Reload" action in IntelliJ. Or it only reload existing download artifacts in your local repo. – Truong Nguyen Sep 12 '22 at 19:55
Go to File | Settings | Build, Execution, Deployment | Build Tools | Maven
Select "Always update snapshots"

- 330
- 1
- 3
- 13
I had a problem where IntelliJ was unable to compile classes, claiming that dependencies between projects were missing. Reimporting the project as suggested in the answers of this question didn't solve the problem. The solution for me, was:
- remove all projects (project tab / right click on the root folder / maven / remove projects);
- close the editor;
- compile all projects with maven on the command line;
- open the editor on the same project;
- add the projects to maven again (maven tab / add maven projects (green +) / choose the root pom);
WARNING: on some projects, you might have to increment max memory for maven import (maven settings on maven tab / Importing / VM options for importer).

- 403
- 4
- 14

- 1,002
- 12
- 14
If you work in IntelliJ, there are four independent ways to refresh maven repositories. Each of them refreshes another local repository on your computer or refreshes them differently.
1. mvn -U clean install
2. Ctrl+Shift+A - Reimport
3. Round arrows in the Maven window
4. Ctrl+Alt+S , go to Build, Execution, Deployment | Build Tools | Maven | Repositories -choose rep - update
What is interesting, it is often said, that the last refresh is equal to the round arrows in the Maven window. But, according to my experience, they are absolutely different! The proof: Our large project fails the last refresh, but exists and runs happily without it. And double round arrows run OK on it.
Each of these four can help you with your problems or/and find problems of its own. For example, for running our real-life project only the first is necessary, but for testing in IntelliJ we also need 2 and 3. Surely, somebody needs 4, too. (Why else IntelliJ has it?)

- 24,044
- 16
- 90
- 149
This is still an issue in 2022.
The option Setting > Maven > Always update snapshots no longer works in IDEA 2022.2.2, probably because Maven 3 frowns upon it and IntelliJ seems to not have updated the IDE to make it function.
A simple solution might be to be able to add maven -U clean install as a custom target to the Lifecycle list in the IDEA Maven tab, but if it is possible it is not clear how to do it (even after googling for days).
A not as nice but viable solution would be to go into the Terminal tool of IDEA and typing maven -U clean install, but IDEA does not expose the maven command in its Terminal by default and again it is not clear how to configure it so that it would.

- 63
- 7
If you are using version ranges for any dependencies, make sure that IntelliJ is using Maven 3 to import the project. You can find this setting in: Settings > Maven > Importing > Use Maven3 to import project
. Otherwise you may find that SNAPSHOT versions are not imported correctly.

- 6,621
- 5
- 53
- 79
There are two ways one can do it.
- 1st Way
Go to File > Settings > Build, Execution, Deployment > Build Tools | Maven
Select "Always update snapshots"
Apply and OK
2nd Way
mvn -U clean install

- 1
- 1
I had this issue, upon checking, i needed to force update snapshots to use the IDEA's maven for the project. So i commanded idea to do a mvn clean compile -U
and my latest version of the dependency is displayed on idea... No need to remove all of the projects settings. Just do this in your ide.

- 467
- 3
- 8
I searched for the jar in ~/.gradle
and then deleted it:
find ~/.gradle/ -name *.jar| grep myjar

- 3,181
- 4
- 15
- 19

- 21
- 4
To remove all dependencies you can simply delete your local maven repo: ~/.m2
folder by default. Then rebuild your projects one-by-one:
mvn clean
mvn package