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.
how to remove unused external libraries Intellij - Stack Overflow
Cleaning the external libraries in Intellij - Stack Overflow
macos - In IntelliJ on OS X, how do you clear out all global setting info, licensing etc. (external to any project) - Stack Overflow
How to exclude External Libraries in IntelliJ from .jar file - Stack Overflow
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.
As mentioned by @maheeka in the question's comments, if the project is a Maven project, the simplest way to achieve updating changed external libraries is to right-click on the project, and select Maven > Reload project.
You can actually see IntelliJ re-indexing the changed libraries individually during the operation in the bottom right status bar.
Tested on v2021.1 Ultimate.
Normally information like this will be found in one of the following places in OS X:
/Users/username/Library/Preferences/AppName
/Users/username/Library/Preferences/com.appname.plist
/Users/username/Library/Application Support/AppName
/Library/Preferences/AppName
/Library/Preferences/com.appname.plist
/Library/Application Support/AppName
If the app adheres to the standard OS X conventions you weill find info in one or all of these places. If it doesnt store here you might check for a /Users/username/.intellij folder or something similar in your home directory
I just ran through this and here is the list of files that I had to delete for IntelliJ 13:
~/Library/Preferences/com.jetbrains.intellij.plist
~/Library/Preferences/com.jetbrains.intellij.plist.lockfile
~/Library/Preferences/IntelliJIdea13
~/Library/Caches/IntelliJIdea13
~/Library/Application Support/IntelliJIdea13
~/Library/Caches/com.jetbrains.intellij
~/Library/Logs/IntelliJIdea13
~/Library/Saved Application State/com.jetbrains.intellij.savedState
You have an icon in the top right of your intelliJ window, right next to the maginifying glass and click on it. It's the icon that looks like a pile of papers in the screenshot I took below.

In the next window, click on Modules in the left sidebar and in the right part of the window, click on the name of your project.
In my case, it's the name of my Spring Artefact project.

Now at the right, you have the context of your intelliJ project.
You can now select the folder you want to add or remove and click on the desired markup.
Hope it helps !
Click on the project, then File > Project Structure.
Go to the Dependencies tab, then find the entry that is adding such folder as a library root and remove that entry and click OK.
