Upgrade dependencies

Upgrade dependencies using Package Search

We will also need to keep our dependencies up to date. To show you how IntelliJ IDEA can help, we are using this extremely outdated project as an example. In the pom.xml below, we see that several dependencies are marked with squiggly lines underneath them.

Outdated Dependencies in pom.xml

IntelliJ IDEA will show the suggestion to upgrade when we hover over the dependency, and we can click the suggestion to upgrade the dependencies.

Hover over outdated dependency

Alternatively, we can use Context Actions ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) to upgrade these dependencies.

Context Actions

We can also upgrade our dependencies using the Dependencies tool window. The Dependencies tool window will tell us if there’s a newer version of a dependency, as we can see here.

Dependencies with newer versions

Note: If you cannot find the Dependencies tool window, make sure the Package Search plugin is installed.

We can choose the version to upgrade to by clicking on the version number in the list. Note that we don’t have to use the latest version.

Select version

We can also automatically upgrade a dependency to the latest version by clicking Upgrade for that particular dependency.

Upgrade individual dependency

Or, we can even upgrade all our dependencies at once, by clicking Upgrade all.

Upgrade all dependencies