IntelliJ IDEA 2016.3 Help

Configuring Project and Global Libraries

On this page:

See also, Library, Configuring Module Dependencies and Libraries and Configuring JavaScript Libraries.

Creating a project or a global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. Depending on the library level, in the left-hand pane of the dialog, select:
    • Libraries if you are going to create a project library.
    • Global Libraries if you are going to create a global library.
  3. Above the pane to the right, click /help/img/idea/2016.3/new.png and select one of the following options:
    • Java. Select this option if you are creating a Java library.
    • JavaScript. Select this option if you are creating a JavaScript library. Note that this option is not available at the project level.
    • From Maven. Select this option if you are going to download a Java library from a public Maven repository.
    • ActionScript/Flex. Select this option if you are creating an ActionScript/Flex library. This option is always present at the global level. A project ActionScript/Flex library can be created only if there is a Flash module in your project.
  4. If you are creating a Java, JavaScript or ActionScript/Flex library, the Select Library Files dialog opens. Select the files and folders that you want to be included in the library.

    If appropriate, the Detected Roots dialog is displayed showing potential library items. Use the check boxes to deselect the unnecessary items.

  5. If you have selected the From Maven option, the Download Library from Maven Repository is shown. Specify the artifact to be downloaded and the destination directory. (To search for the artifact, you can use a class name, a keyword or a search pattern, or Maven coordinates.) Optionally, select Sources and/or JavaDocs for the source code and documentation to be included.
  6. If you are creating a Java library, the Choose Modules dialog is shown. Select the modules in which the new library will be used.
  7. If you are creating an ActionScript/Flex library, the Choose Flash Build Configurations dialog is shown. Select the build configurations in which the new library will be used.
  8. If necessary, edit the library name and contents.
  9. For a JavaScript library, specify its usage scope.
  10. Click OK in the Project Structure dialog.

Adding items to a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click /help/img/idea/2016.3/new.png. (For a JavaScript library, click /help/img/idea/2016.3/new.png and select Attach Files or Directories.)
  5. In the dialog that opens, select the files and folders that you want to be included in the library, and click OK.
  6. Click OK in the Project Structure dialog.

Removing items from a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, select the library items to be removed, and click /help/img/idea/2016.3/delete.png.
  5. Click OK in the Project Structure dialog.

Specifying online documentation URL for a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click /help/img/idea/2016.3/icon_doc_url.png. (For a JavaScript library, click /help/img/idea/2016.3/new.png and select Specify Documentation URL instead.)
  5. In the dialog that opens, specify the documentation URL and click OK.
  6. Click OK in the Project Structure dialog.

See also, Viewing Reference Information.

Making items excluded in a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, click /help/img/idea/2016.3/iconLibExclude.png.
  5. In the dialog that opens, select the items that you want to make excluded, and click OK. (You can exclude folders, archives (e.g. JARs) and folders within the archives.)

    As a result, the items with the excluded status appear, the ones shown as /help/img/idea/2016.3/rootExcluded.gif.

  6. Click OK in the Project Structure dialog.

See also, Excluded library items.

Cancelling the excluded status of items in a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. In the right-hand part of the dialog, on the Project Library or the Global Library page, select the items whose excluded status you want to cancel. (The items with the excluded status are shown as /help/img/idea/2016.3/rootExcluded.gif.)
  5. Click /help/img/idea/2016.3/delete.png.
  6. Click OK in the Project Structure dialog.

See also, Excluded library items.

Creating a copy of a project or global library

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. Click /help/img/idea/2016.3/copy.gif.
  5. In the Copy Library dialog, specify the library name and click OK.
  6. Click OK in the Project Structure dialog.

Creating a copy of a global library at the project level

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, select Global Libraries.
  3. In the pane to the right, right-click the library of interest and select Copy to Project Libraries.
  4. In the Copy Library dialog, specify the name of the library. If you want a copy of the library files to be created, select the Copy library files to check box and specify the corresponding location.
  5. Click OK in the Project Structure dialog.

Moving a project library to a global level

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, select Libraries.
  3. In the pane to the right, right-click the library of interest and select Move to Global Libraries.
  4. In the Move Library dialog, if necessary, change the library name. If you want to change the location of the library files, select the Move library files to check box and specify the corresponding location.
  5. Click OK in the Project Structure dialog.

Adding a project or global library to module dependencies

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, right-click the library of interest and select Add to Modules.
  4. In the Choose Modules dialog, select the modules in which the library will be used, and click OK.
  5. Click OK in the Project Structure dialog.

See also, Dependencies and Adding existing libraries to module dependencies.

Finding usages of a project or global library in a project

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, depending on the library level, select Libraries or Global Libraries.
  3. In the pane to the right, select the library of interest.
  4. Click /help/img/idea/2016.3/find.png.

Deleting project and global libraries

  1. Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
  2. In the left-hand pane of the dialog, select Libraries or Global Libraries.
  3. In the pane to the right, select the libraries to be deleted.
  4. Click /help/img/idea/2016.3/delete.png.
  5. Click OK in the Project Structure dialog.

See Also

Last modified: 21 March 2017