You can configure Maven settings at the IDE level and at the project level. At the IDE level you can configure Maven installation and repository details and define global Maven goals. At the project level you can create configurations to activate Maven profiles and bind IDE actions to Maven goals for a project.
You configure Maven settings that effect the behavior of Maven in the IDE in the Options window. In the Options window you can specify a local Maven installation, the location of the local Maven repository and settings for updating the repository.
By using the project's Properties window you can configure Maven settings for an individual project. You can create custom configurations and then bind IDE actions to Maven goals and assign the binding to a configuration.
Using Project Configurations
The Configurations category of the Properties window of a Maven project enables you to create and select custom configurations for your project. For example, you can create custom configurations to do the following:
To create a custom configuration for a project perform the following steps.
Alternatively, right-click the project node and choose Properties and select Configurations in the Properties window.
By default this option is deselected and configurations are shared between instances of the IDE when the project is opened, for example when you open the project in an updated version of the IDE.
The name of the configuration that is currently active is in bold.
When you click OK the IDE creates a configuration file in the root directory of the project with the name nbactions-myconfigurationname.xml.
To activate a configuration for a project, right-click the project node and choose Set Configuration and then choose the configuration name in the popup menu. You can also use the drop-down list in the toolbar to switch between configurations for the project that is currently selected in the Projects window. If a project is set as the main project the dropdown list will display the configurations for the main project.
Binding IDE Actions to Maven Goals
You can use the Actions category in the Properties window to customize IDE actions by binding the action to Maven goals. The Actions pane lists the IDE's default project actions that can be mapped to Maven goals. You can assign the mapping to a project configuration if you activated configurations for the project.
After you select an IDE action you can modify the Maven goals and properties of the action by typing in the textfield. Actions are displayed in bold if the default values for the action have been modified. The following textfields display the goals and properties associated with the selected action.
You can type in the text area to add a property or click the Add button to view and add one of the default properties.
When you select an action you can select the Build with Dependencies checkbox if you want to run the Build with Dependencies command as part of the action.
Creating Custom Actions
You can create custom actions for a project by clicking Add Custom in the Actions category of the Properties window. After you create the new action you can specify the goals or properties for the new action. You can invoke the new action by right-clicking the project node in the Projects window and then choosing the action under Custom in the popup menu.
You can also create global custom goals for Maven projects by clicking Edit Global Custom Goal Definitions in the Maven tab in the Options window. The global goal is then listed in the popup menu under Custom when you right-click a Maven project in the Projects window.