Free MuleSoft CONNECT Keynote & Expo Pass Available!

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

Converting Maven into Studio

You may wish to leverage Studio’s graphical user interface by importing a Maven project into Studio.

Important: if you use the Maven studio:studio goal, you cannot use the m2eclipse plugin, because it will override the studio:studio goal. Mule Studio has built in capabilities for importing and exporting between Maven and Studio using the studio:studio goal, which covers most use cases.

Importing a Maven Project into Studio

To use Studio’s built-in functionality to import a Maven project, you must have a clean Maven project with no-Eclipse specific files.

  1. In Studio, go to File > Import…​

  2. Select Maven-based Mule Project from pom.xml, then click Next

  3. Navigate to the location of the pom.xml file you wish to import. Mule automatically populates a Project Name, but you can adjust it.

  4. Be sure to select the runtime you wish to use. Check the box to Copy project into workspace if you want to create a copy of your project that resides in your workspace.

  5. Click Finish

Mule Studio runs the studio:studio goal to import the project into Studio.


M2_REPO Classpath Variable Errors

If after you open you Maven project in Studio and encounter error messages (as illustrated below), you may need to set the M2_REPO classpath variable or, if it has already been set, re-point it to the correct repository.

  1. In Studio, right-click your project’s name in the Package Explorer, then select Properties.

  2. In the Properties pane, click Jave Build Path in the menu on the left, then click the Libraries tab.

  3. Click Add Variable…​

  4. In the New Variable Classpath Entry panel, click the Configurable Variable…​ button.

    Select the M2-REPO item from the list of classpath variables, then click Edit…​

    If M2_REPO does not appear as an item in the list of classpath variables, click New…​ to create this classpath variable.
  5. Change the contents of the Path field to specify the location of your Maven (m2) repository.

  6. Click OK in each of the open panels to save your changes.

  7. Click the Problems tab in the console to confirm that the errors are no longer listed, which means they have been resolved.

Missing Required Repositories

If you encounter errors like this, some dependencies or artifacts cannot be resolved.

Failed to execute goal on project shcema-extractor-plugin: Could not resolve dependencies for project org.mule.tooling:schema-extractor-plugin:maven-plugin:1.0-SNAPSHOT…​

Ensure that the required plugin repositories are included in your pom file:

            <name>mulesoft release repository</name>

See Also