IntelliJ IDEA 2016.1 Help

Enabling Spring Support

To enable Spring support:

  • Make sure that all the necessary IntelliJ IDEA plugins are enabled. These are the Spring Support plugin (for general Spring support) and also a number of other, more specific plugins (Spring Security, Spring Integration, etc.).
  • Create a Java module with a Spring facet or add a Spring facet to an existing Java module.

On this page:

To make sure that the Spring Support and other Spring plugins are enabled

  1. Open the Settings dialog (e.g. Ctrl+Alt+S).
  2. In the left pane, select Plugins.
  3. In the right pane, on the Plugins page, type spring in the search box. As a result, only the plugins whose names and descriptions contain spring are shown in the list of plugins.
  4. If the check box to the left of Spring Support is not selected, select it. If you are going to use particular Spring frameworks (Spring Security, Spring Integration, etc.), make sure that the check boxes next to their names are also selected.
  5. Click OK in the Settings dialog.
  6. If suggested, restart IntelliJ IDEA.

To create a module with a Spring facet

Depending on the situation, you can choose to create a new project or add a module to an existing project.

  1. Do one of the following:
    • If you are going to create a new project: click Create New Project on the Welcome screen or select File | New | Project.

      As a result, the New Project wizard opens.

    • If you are going to add a module to an existing project: open the project you want to add a module to, and select File | New | Module.

      As a result, the New Module wizard opens.

  2. On the first page of the wizard, in the left-hand pane, select Spring. In the right-hand part of the page, specify the JDK that you are going to use.
  3. Select the required library option and, if necessary, specify the associated settings. You can choose to:
    • Download and use a Spring implementation library.

      To do that, select Download.

      Now, to view or modify the associated options, click Configure, and in the Downloading Options dialog that opens:

      • Select the Spring version that the library should implement.
      • Specify the library name.
      • Select the library level (global, project, or module).
      • Under Files to download, select which of the files you want to download.
      • Under Copy downloaded files to, specify the path to the destination folder. If you want to change the default path, click browseButton and specify the folder location in the dialog that opens.
    • Use a Spring library IntelliJ IDEA is already aware of.

      To do that, click Use library and select the required library from the list.

      If necessary, configure the library settings (for example, change its name). This is done in the Edit Library dialog which you can open by clicking Configure.

    • Create a new library using the appropriate JAR files available on your computer.

      To do that, click Use library and then click Create. Select the required JAR files in the dialog that opens. (Keep the Ctrl key pressed to perform multiple selection.)

      If necessary, configure the new library (for example, change its name or level). To do that, click Configure and specify the required settings in the Create Library dialog.

    • Postpone setting up the library until a later time. In this case, select Set up library later.
  4. If you want to enable support for more specific Spring features or frameworks (for example, Spring Security, Spring Integration, etc.), select the corresponding check boxes and specify the associated library options. The procedure is similar to that for the Spring library.

    Click Next.

  5. Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location.

    Click Finish.

To add a Spring facet to an existing module

  1. Open the Project tool window (e.g. View | Tool Windows | Project).
  2. Right-click the module and select Add Framework Support.
  3. In the left-hand pane of the Add Frameworks Support dialog, select the Spring check box.
  4. Select the required library option and, if necessary, specify the associated settings. You can choose to:
    • Download and use a Spring implementation library.

      To do that, select Download.

      Now, to view or modify the associated options, click Configure, and in the Downloading Options dialog that opens:

      • Select the Spring version that the library should implement.
      • Specify the library name.
      • Select the library level (global, project, or module).
      • Under Files to download, select which of the files you want to download.
      • Under Copy downloaded files to, specify the path to the destination folder. If you want to change the default path, click browseButton and specify the folder location in the dialog that opens.
    • Use a Spring library IntelliJ IDEA is already aware of.

      To do that, click Use library and select the required library from the list.

      If necessary, configure the library settings (for example, change its name). This is done in the Edit Library dialog which you can open by clicking Configure.

    • Create a new library using the appropriate JAR files available on your computer.

      To do that, click Use library and then click Create. Select the required JAR files in the dialog that opens. (Keep the Ctrl key pressed to perform multiple selection.)

      If necessary, configure the new library (for example, change its name or level). To do that, click Configure and specify the required settings in the Create Library dialog.

    • Postpone setting up the library until a later time. In this case, select Set up library later.
  5. If you want to enable support for more specific Spring features or frameworks (for example, Spring Security, Spring Integration, etc.), select the corresponding check boxes and specify the associated library options. The procedure is similar to that for the Spring library.
  6. Click OK in the Add Frameworks Support dialog.

See Also

Language and Framework-Specific Guidelines:

Last modified: 13 July 2016