You can go to Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing and check the box that says Import Maven projects automatically.

In Mac, you can do Command + Shift + A, then enter the action reimport, then click on Reimport all Maven projects.

Answer from chepukha on Stack Overflow
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360010618919-IntelliJ-Idea-not-removing-external-libraries
IntelliJ Idea not removing (external) libraries – IDEs Support (IntelliJ Platform) | JetBrains
April 21, 2021 - Actual: 4) run 'reload all maven projects' (maven toolwindow) > the dependency is not removed from 'external libraries' and in case of version change the new version is added as library => 2 versions of the same library 5) searching in the project folder it also/still appears in the .iml file under <orderEntry/> The removed versions keep coming back. To fix this I tried: - manually deleting those libraries in IntelliJ: this works until the next 'reload' which load all the versions you ever entered - manually deleting the .iml file: as soon as this file is recreated, the problem returns - manually deleting the .idea folder: solves the problem of the returning bad versions until you change a dependency version or remove the dependency.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206878515-How-do-I-remove-unused-dependencies-from-the-project-
How do I remove unused dependencies from the project? – IDEs Support (IntelliJ Platform) | JetBrains
April 12, 2013 - Upon re-build, Maven will pull in the version and repopulate the jar file in the entry. Example in IntelliJ external library: Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.30. Expand that entry to get: tomcat-embed-core-9.0.30.jar. Delete the jar file (which also deletes the Mavem: org...
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360003682939-How-do-you-remove-something-from-External-Libraries
How do you remove something from "External Libraries"? – IDEs Support (IntelliJ Platform) | JetBrains
I'm on a workstation that has Python27, but I'm trying to write in a virtualenv of 3.7. I can do this outside of PyCharm just fine by changing the PATH files, but IN PyCharm, I can't seem to exclude Python27 from the External Libraries.
🌐
Stack Overflow
stackoverflow.com › questions › 52356711 › how-to-remove-unused-external-libraries-intellij
how to remove unused external libraries Intellij - Stack Overflow
I am working on a project with Intellij and for some reason we imported too many libraries. now I need to remove all the unnecessary libraries. is there a way to remove them without removing the actually used libraries? ... Delete the dependencies which you don't believe are necessary until your application doesn't compile? ... the problem is that I don't know which is necessary and which is not. I was looking for a way to let me know that. and also the problem is not with the dependencies, the problem is with the external jars I guess ... Why do you have external JARs loaded into your project if you're relying on Maven to resolve your dependencies?
🌐
GitHub
github.com › flutter › flutter-intellij › issues › 2184
Manually deleting library from the External Libraries folder doesn't delete or return · Issue #2184 · flutter/flutter-intellij
May 1, 2018 - From @branflake2267 on June 14, 2017 4:41 Steps to Reproduce select folder in external library delete folder (library) run packages get (note the library didn't delete from module settings libraries) After I deleted them from the module ...
Author   flutter
🌐
JetBrains
youtrack.jetbrains.com › issue › IJPL-12270 › Delete-all-unused-libraries
Delete all unused libraries : IJPL-12270
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
Find elsewhere
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 207108385-IntelliJ-not-able-to-resolve-classes-of-external-Libraries-for-Maven-projects
IntelliJ not able to resolve classes of external Libraries for Maven projects – IDEs Support (IntelliJ Platform) | JetBrains
February 2, 2016 - 3. External dependencies shows everything, it could be that the dependency is added to some other module and the module that has the problem doesn't have this specific dependency for some reason. Please try to delete .idea directory and .iml files, then reimport the project from Maven. ... Can I consider adding the required libraries for the particular module as dependencies?
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206903515-Not-all-Maven-dependencies-appear-in-External-libraries
Not all Maven dependencies appear in "External libraries" – IDEs Support (IntelliJ Platform) | JetBrains
March 29, 2012 - All those libraries are in the main repo and if I run mvn clean install from the command line it works fine. I mean, this is an IntelliJ problem, not something wrong with Maven and its dependencies....
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360000156724-How-to-remove-downloaded-library-from-local-Maven-repository
How to remove downloaded library from local Maven repository – IDEs Support (IntelliJ Platform) | JetBrains
March 22, 2018 - I have downloaded several versions of different libraries from Maven since I started using IntelliJ. This is starting to take up a substantial amount of disk space. Many of these library versions...
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206173719-Changes-to-external-Java-library-not-picked-up-by-compiler
Changes to external Java library not picked up by compiler? – IDEs Support (IntelliJ Platform) | JetBrains
February 24, 2015 - But for some reason, my source file still has an error flag saying the type is wrong. I've tried doing a Synchronize on the file, the module, and even on the external JAR in the library section of the project tree. I also tried using the Maven panel to compile, do a clean/install, reimport the module, and even reimport all modules.
🌐
JetBrains
jetbrains.com › help › idea › library.html
Libraries | IntelliJ IDEA Documentation
Under Platform Settings, select Global Libraries. ... Select Java or Kotlin/JS to add a library from the files located on your computer. Select From Maven to download a library from Maven. In this dialog, you can also: add classes to an existing library, specify an external documentation URL, exclude items from a library, or remove a library.
🌐
Eugene Petrenko
jonnyzzz.com › blog › 2013 › 05 › 13 › removing-unused-dependencies-in-idea
Removing Unused Dependencies in IDEA Projects – Eugene Petrenko
In this post I write about Jonnyzzz Dependencies plugin that helps one to remove unused dependencies between modules and libraries
Top answer
1 of 11
47

Maven > Lifecycle > clean

Open the Maven Projects panel. Click lower-left corner for pop-up menu if that panel is not already visible.

In that panel, open the Lifecycle item. There you will find clean and install items for you to run.

As commented, you can also invoke this by command-line/console. But if already using IntelliJ, I do not see the point. Just show/hide this pane as you work. I use it countless times a day to hit install to build complete app, and hit clean whenever I suspect not all of the project is up-to-date in the build-results.

Build > Rebuild Project

If you are having weird problems in running the app in development also try the menu item Build > Rebuild Project.

I have asked what is the difference between a Build > Rebuild Project versus doing a Maven clean. But I still do not understand the precise details. So when things seem wonky, I do both to right the ship.

Tips:

  • Restarting IntelliJ may help when behavior seems odd.
  • Keep Intellij updated.
2 of 11
22

The answer here with the most votes suggests running the clean and install Lifecycle items separately in IntelliJ, which is easy enough and works. But it’s worth mentioning that you can combine these steps (and/or others) by instead creating a new Run/Debug Configuration of type maven and adding the command clean install (or whichever combination of maven lifecycle methods you run on a recurring basis).

Thereafter, running a mvn clean install is as simple as clicking the green button to run that Run/Debug Configuration.

🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206633455-Duplicate-library-dependency-after-version-change
Duplicate library dependency after version change – IDEs Support (IntelliJ Platform) | JetBrains
June 30, 2015 - 1. close idea 2. go to project folder and clean it with these three commands: rm -rf **/*.iml rm -rf .idea/misc.xml rm -rf .idea/libraries/ 3. open idea and import the project again (for me this means only "add pom as maven project", not sure ...
🌐
Gradle
discuss.gradle.org › help/discuss
External Dependencies not pulled after clearing gradle cache - Help/Discuss - Gradle Forums
July 5, 2017 - This is a boiler plate gradle file from Spring.io. I added few dependencies like okhttp and following that i had add gson dependency to prettify json. but the last dependencies never appears in the project compilation in IntelliJ. I can’t use the library. Infact can’t use any latest library.