IntelliJ IDEA 12.1.0 Web Help

On this page:

See also, Configuring JavaScript Libraries.

Creating a project or a global library
  1. Open the Project Structure dialog.
  2. Depending on the library level, in the left-hand pane of the dialog:
    • Click Libraries if you are creating a project library.
    • Click Global Libraries if you are creating a global library.
  3. Click add on the toolbar and select:
    • If you are creating a Java library, select Java.
    • If you are creating a JavaScript library, select JavaScript . Note that this option is not available at the project level.
    • If you are going to download a Java library from a public Maven repository, select From Maven.
    • If you are creating an ActionScript/Flex library, select ActionScript/Flex. Note that this option is available at the project level only if your project contains at least one Flash module.
  4. If you are creating a Java, JavaScript or ActionScript/Flex library, the Select Library Files dialog opens. Select the files and folders that contain the library resources.

    If appropriate, the Detected Roots dialog is displayed showing the library resources found in the folders you have selected. Use the check boxes to deselect 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 directory to download the artifact to. (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, and click OK.

    Note

    If you deselect all the modules or click Cancel in the Choose Modules dialog, the new library will still be created. You will be able to associate this library with any of the modules in the current project at a later time. (See Adding existing libraries to module dependencies.)

  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, and click OK.
  8. If necessary, edit the library name and configure the library contents.
  9. For a JavaScript library, specify its usage scope.
Configuring the contents of a project or a global library
  1. Open the Project Structure dialog and select the library whose contents you want to configure. (To see the list of libraries, select Libraries or Global Libraries in the left-hand pane. The corresponding list is shown in the area under project_structure_toolbar_2.)
  2. Use add and delete in the right-hand part of the dialog to configure the library contents. For more information, see Project Library and Global Library Pages.
  3. When happy with the library contents, click OK in the Project Structure dialog.
Creating a copy of a project or a global library
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Libraries or Global Libraries.
  3. In the area under project_structure_toolbar_2, select the library of interest.
  4. Click copy.
  5. In the Copy Library dialog, specify the library name and click OK.
Creating a copy of a global library at the project level
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Global Libraries.
  3. In the area under project_structure_toolbar_2, 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.
Moving a project library to a global level
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Libraries.
  3. In the area under project_structure_toolbar_2, 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.
Adding a project or a global library to module dependencies
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Libraries or Global Libraries.
  3. In the area under project_structure_toolbar_2, 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.
Finding usages of a project or global library in a project
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Libraries or Global Libraries.
  3. In the area under project_structure_toolbar_2, select the library of interest.
  4. Click find.png.
Deleting project or global libraries
  1. Open the Project Structure dialog.
  2. In the left-hand part of the dialog, click Libraries or Global Libraries.
  3. In the area under project_structure_toolbar_2, select the libraries to be deleted.
  4. Click delete.

See Also

Concepts:

Procedures:

Reference:

Web Resources: