In the Project tool window, select the package or directory
in which you want to create a configuration file.
Then choose File | New or press Alt+InsertCommand N; Command Enter.
Alternatively, right-click the package or directory, and click New.
- Select XML Configuration File and then select Spring Config. Note that, as an alternative, you can also select to create a more specific type of Spring configuration file (e.g. Spring Security).
In the New File dialog, specify the name of the configuration file and click OK.
As a result, the new configuration file is created and opened in the editor.
- If necessary, add the configuration file to a file set.
Unless an XML configuration file is included in at least one file set, the Configure File Set link is available in the editor for the configuration file. This link is located above the editing area, in the upper-right corner of the corresponding editor tab.
You can use this link to add the configuration file to a file set:
- Click the Configure File Set link.
If you haven't defined any XML file sets yet,
the Edit Application Context dialog opens.
Configure the file set as required and click OK.
If at least one XML file set already exists, you can add the configuration file to an existing file set or create a new file set and add the configuration file to it. To do that, select the necessary option from the Choose file set menu:
- To add the configuration file to an existing file set, select the necessary file set.
- To add the configuration file to a file set that does not yet exist, select <new file set>. Then, in the Edit Application Context dialog, configure the file set and click OK.
The procedure for creating @Configuration-annotated Java classes is the same as for creating "ordinary" classes, see CreatingJavaClasses, Interfaces, Enumerations and Annotations.