Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Maven Support in Anypoint Studio

The following sections describe how to enable or disable Maven support for your projects in Anypoint Studio. 

Setting Your Maven Preferences

You can adjust your Studio preferences so that Studio automatically generates a pom.xml file upon project creation.  

  1. Navigate to Anypoint Studio > Preferences (or Windows > Preferences in Windows).

  2. In the Preferences panel, click to expand Anypoint Studio, then select Maven Settings.

  3. Click to select both Enable Maven support in Anypoint Studio and Enable automatic maintenance of pom.xml

    Mavensupport

  4. Adjust the filepath of the Maven installation home directory on your local drive, if it is empty or if you wish to use a different installation than the one Studio detected automatically.

  5. Click Test Maven Configuration to instruct Studio to run mvn --version in the background to validate your Maven installation. Studio produces an output of that command in a box below the button. The results will flag any problems with your settings, such as a missing JAVA_HOME environment variable.

    TestMaven

    OS X Mavericks

    If you are running OS X Mavericks, Studio cannot automatically find your Maven installation, so your home directory field will be blank and the Maven support boxes unchecked. 

    To use Maven with Anypoint Studio on Mavericks, configure your Maven home directory manually. Once you have configured a valid Maven home, click Test Maven Configuration to verify your settings.

  6. When finished, click OK to save your changes.

Disabling Maven Support in Studio

You can adjust your Studio preferences so that Studio does not auto-generate a pom.xml file for new projects.  The following procedure outlines the steps to disable Maven support in your instance of Studio.

  1. Navigate to Anypoint Studio > Preferences (or Windows > Preferences in Windows).

  2. In the Preferences panel, click to expand Anypoint Studio, then select Maven Settings.

  3. Click to deselect both Enable Maven support in Anypoint Studio and Enable automatic maintenance of pom.xml

  4. Click OK to save changes to Preferences.

When you create a new project in Studio, the option to Use Maven is grayed out.

MavenSettingsDisabled

Click configure Maven to re-enable Maven for your Studio instance, or return to the Preferences and adjust your settings there.

Disabling Maven Support in a Single Studio Project

If you have created Maven project in Studio and wish to disable Maven support for that particular project, right-click the project name in the Package Explorer, then select Mule > Disable Support. Though it does not remove the pom.xml file, Studio ceases to maintain it for the project. 

You can re-enable Maven support via the Studio menu item if you did not delete the pom.xml file. Right-click the project name in the Package Explorer, then select Mule > Enable Support.

If you disable Maven support in your Studio project and delete the pom.xml file, you cannot re-enable it via the Maven Support in Studio menu item. To re-initiate Maven support, consult the Enabling Maven Support for a Studio Project documentation.

See Also