Setting Up a DevKit Development Environment
This document explains how to prepare a development environment that includes all the components required to develop Anypoint Connectors. You must have the following components installed and working in your local environment:
-
Java IDE in which to write the code for your connector
-
Java Development Kit 7 (JDK 7) to compile and build your Java code
-
Maven to manage your project’s build
-
Mule Studio as the IDE in which to test your connector
The sections below describe the specific details necessary for setting up your connector development environment.
Assumptions
This document assumes that you are familiar with a Java IDE (Eclipse or IntelliJ) and have some familiarity with the Maven build manager for Java. Further, it assumes that you know how to install an instance of JDK 7 on your platform (Windows, Mac, or Linux).
Java IDE Requirements
To build Anypoint Connectors for Mule, you need a Java IDE with Maven support. Although you can use any Java IDE with Maven support, the following are commonly in use by developers:
-
Eclipse installed as part of Mule Studio, with m2eclipse installed
-
IntelliJ IDEA, which has built-in Maven integration
While IntelliJ IDEA and m2eclipse provide integration between the IDE and Maven, each depends on the presence of a standalone Maven instance in your environment. |
Alternatively, you can install one of the following to use in place of an IDE:
-
A standalone Eclipse installation is an easily configured foundation for a development environment for Anypoint Connectors. Install Eclipse 3.8 (Juno), then add the m2e Maven tooling for Eclipse to plug Eclipse into your connector team’s daily development cycle.
-
IntelliJ IDEA is another common, popular IDE for Java, for which a free community edition is also available. The biggest advantage of IntelliJ IDEA for connector development is that Maven support is built into IntelliJ IDEA, which eliminates a source of configuration effort in setting up your environment.
JDK 7
Oracle makes JDK 7 freely available for all supported platforms, including Windows, Mac OS X and Linux. Download the latest Java Development Kit 7 (JDK) for your platform and install.
Maven Build Manager
When building a connector, you use the Maven build manager to generate a new connector project, and for ongoing build activities during the connector development process. If you are not familiar with Maven, Maven in Five Minutes provides a brief introduction to the concepts and basic commands.
-
Download the Maven distribution from the Maven download page.
-
Unpack the download to a folder on your local drive.
-
Create an environment variable called
M2_HOME
, then set it to the folder into which you unpacked Maven. -
Update the
PATH
environment variable to include the path to Maven binaries.-
Windows: add the following line to the PATH variable: `%M2_HOME%\bin `
-
Mac or Linux: add the following line to the PATH variable:
$M2_HOME/bin
-
For more detailed instructions and installation options, see the Maven download page; instructions for different platforms are available below the download links.
Maven Tooling for Eclipse
The m2e
plugin for Eclipse enables Eclipse to import Maven projects and update the meta-information for them. m2e
also includes the dependency management capabilities of Maven, so any necessary libraries are downloaded and configured correctly in Eclipse when you import or update a project.
Follow the procedure below to install m2e as a plugin in Eclipse 4.3 or later.
-
In Eclipse, under the Help menu, select Install New Software.
-
In the Work with field of the Install panel, use the drop-down to select the following URL:
m2eclipse Update Site - http://download.eclipse.org/technology/m2e/releases
If the m2eclipse update site does not appear as an option in the drop-down menu, you can click Add, then manually enter the URL.
Further, if using an earlier version of Eclipse, you may need to download a corresponding previous version of m2e. In Eclipse, go the the Eclipse Marketplace (Help > Eclipse Marketplace…) to find the version of m2e you need to install.
-
In the table, select Maven Integration for Eclipse, then click Next.
-
In the Install Details window, click Next to continue installation.
-
In the Review Licenses window, accept the terms of the license agreement, then click Finish.
-
After Eclipse completes installation of the
m2e
plugin, click Restart Now to complete the installation and restart Eclipse.
Mule Studio
As a DevKit developer, you need Mule Studio to test your connector. If you have not already installed Mule Studio, follow the detailed instructions to install. For a quick introduction to Mule Studio, review Mule Studio Essentials.
You can also use Mule Studio, with m2eclipse installed, as your DevKit IDE (running a second instance, alongside your test environment) to build your connectors.
See Also
-
NEXT: Continue to the next step by Preparing API Access or a Sandbox Environment.
-
Eager to begin coding? Use the DevKit Shortcut to Success for a quick walkthrough of the entire development process.