IntelliJ IDEA 2024.1 Help

Package Search

Package Search lets you search, evaluate, and manage dependencies inside the IDE. It is supported for main build tools such as Maven, Gradle, and sbt.

You can use the Dependencies tool window to work with dependencies.

  1. Depending on a build tool in your project, open the appropriate build script in the editor.

  2. Press Alt+Insert and in the list that opens, select Add dependency.

  3. In the Dependencies tool window, search for the dependency you need, select it in the list of search results and click Add.

Work with the Dependencies tool window

The Dependencies tool window provides a list of modules you have as well as a list of all currently installed packages in your project.

Dependencies with a white background are the installed ones. IntelliJ IDEA only shows direct dependencies that you explicitly declared.

User defined dependencies

The dependencies with a light blue background are your search results.

Package search results

For each dependency IntelliJ IDEA displays information such as the source code links, activity on StackOverflow, GitHub, and all accessible directly with links from the entry. For more information, refer to Dependency details pane.

You can use the Dependencies tool window to add, remove, and update packages.

Add a dependency

  1. In the Dependencies tool window, select a module for which you want to add a dependency.

    To add a dependency for the whole project, select All Modules.

  2. In the search field, start typing your query.

  3. In the list of search results, locate the package you want to add.

    You can select a scope for which you want to add your package. The names of scopes are based on the build tool with which you are working.

    The available scopes can be configured in the Package Search settings. The settings also contain scopes you use in your build script file. However, keep in mind that if you specify a non-existing configuration in the settings, it won't be generated in your build script file.

  4. Click Add.

Change a dependency's version

  1. In the Dependencies tool window, locate the dependency for which you want to change the version.

  2. Click the drop-down version selection list and select the needed version.

    If you select the Only stable checkbox, IntelliJ IDEA will exclude any dependencies that have no stable versions, and hide them from the list. Otherwise, IntelliJ IDEA displays the latest possible version and you can click Upgrade to change it.

    Upgrade dependency

    If you select the Kotlin multiplatform option, IntelliJ IDEA will display only the Kotlin multiplatform dependencies.

Remove a dependency

  1. In the Dependencies tool window, select a module from which you want to remove a dependency.

    To remove a dependency from the whole project, select All Modules.

  2. Select the dependency you want to remove and in the dependency's details pane, click the More button and select Remove.

    IntelliJ IDEA removes the dependency from the selected module.

Copy dependency's coordinates

  1. In the Dependencies tool window, select a package you want to copy.

  2. In the dependency's details pane, right-click the library name and its coordinates and select Copy.

    Copy a package

    IntelliJ IDEA copies the dependency to a clipboard.

Access the Package Search settings

You can use the Package Search settings to configure additional options for the behavior of the Package Search plugin.

  1. Press Ctrl+Alt+S to open the IDE settings and then select Build, Execution, Deployment | Package Search.

  2. From the options on the left, edit the needed build tools section and click OK to save the changes.

Dependency details pane

The dependency details' pane displays the following information about the selected dependency:

  • Dependency description if it is available

  • Repository or repositories in which the dependency is available

  • The authors of the dependency if the names are available

  • GitHub information if the dependency sources are hosted on GitHub and also Readme

  • Dependency website and a link to the documentation

  • List of usages in the current module. This information is available only for the installed dependencies and filtered ones based on the selection in the list of dependencies.

  • Supported Kotlin or Multiplatform platforms if it is a KMP dependency

Package details

You can use the icons on the toolbar to hide or restore the details' pane, access the Package Search settings, and manipulate the tool window.

Last modified: 11 February 2024