Customize and enrich the functionality of the Anypoint Studio with Eclipse plugins

Karim Djaafar
Another Integration Blog
9 min readJul 25, 2023

By Karim DJAAFAR

Tech Lead of Jasmine Conseil and MuleSoft Architect

MuleSoft Anypoint Platform is a world class integration platform that makes it easy to integrate various technologies without having to write a lot of code. However, sometimes Java developers have their own favorite tools and plugins, so it’s worth while to note that you can personalize your Anypoint Mule development environment using Eclipse IDE ecosystem to combine harmoniously each of the two worlds in your integration project.

Presentation

In this article I will describe the steps needed in order to construct your own customizable IDE Eclipse environment with the Mule plugin. This will allow for more flexibility and options with you favorite Eclipse plugins — particularly if you want to use your favorite Maven archetypes in your daily projects.

What is Anypoint Studio?

Anypoint Studio features enhance your productivity when building Mule applications:

o Instant run of your Mule application inside a local runtime

o Visual editors to configure API specification files and Mule domains

o Push changes to a local running app to test changes

o Integration with Exchange to create projects from templates and examples, and import definitions and other resources from your Anypoint Platform organization

o Embedded unit testing framework

o Built-in support to deploy to CloudHub

Anypoint Studio 7.x only supports Mule 4.x projects because the structure of the project, export format, XML and scripting language are different. It isn’t possible to embed Mule 3.x runtimes or older versions into Anypoint Studio 7.x.

The Anypoint platform includes out-of-the-box support for cloud connectors which allow flows to interact with many powerful cloud technologies such as Salesforce.com, Amazon S3, Dropbox, Twitter, Google Calendars, and GitHub.

NOTE: For a full list of connectors, take a look at the connectors reference.

Configuring your Eclipse Tools bundle

In this first section we will customize our Eclipse with the following detailed Eclipse tools but let’s first check the prerequisites…

Step 1: Verifying your prerequisites

To install Anypoint Studio you need at least 8GB of memory. By experience we recommend 16 go of memory and 100Go of space to begin, especially when you will have many flow diagrams and projects at the time of your MuleSoft developer daily life.

Plan a muscular hardware machine configuration with an iCore i7 type processor and 8 cores. If you use machines based on Intel processors or if you are an Apple fan, a MacBook Pro type machine will be ideal if you are also a nomadic developer.

Anypoint Studio is an Eclipse-based user interface that allows you to graphically create Mule flows and execute them locally.

As a recall, if needed, Eclipse platform and the Eclipse IDE is an extensible framework which allows to add additional functionality, remove, or customize existing functionality.

There are two ways to install Anypoint Studio:

- As a bundle available on the official MuleSoft website: https://www.mulesoft.com/platform/studio . Here, you just unzip and follow the installation steps.

- As an Eclipse plug-in

In this tutorial I will focus on installation as an eclipse plugin as is it more customizable inside Eclipse and doesn’t break the Anypoint Studio installation.

Step 2 — Anypoint Studio installation as an Eclipse plug-in

In our presentation we will use Eclipse IDE 2023–06 available on the Eclipse official web site https://www.eclipse.org/downloads/.

The desktop package is available for x86_64 (windows) and AArch64 (Mac). In my case Iwill choose the Mac package.

After launching the eclipse installer choose the Eclipse IDE for Java Developer install which is sufficient in our case as a MuleSoft Developer:

Fig 1 — Eclipse JEE Installer option

Select the Java version (17 in my case) and the installation folder and click install.

The installation process begins and installs Eclipse in your workstation by creating an eclipse shortcut in your personal home folder.

Launch Eclipse and select your workspace:

Fig 2 — Specifying an Eclipse workspace

Click Launch, you will get after stating this Welcome page:

Fig 3 — Eclipse Welcome page

Click Hide, your Eclipse installation is now fully available !

Fig 4 — Eclipse Dashboard after first installation

As you can see, the Eclipse for Java Enterprise comes with very useful tools, as shown in the Show View inside the IDE option menu of Eclipse :

Fig 5 — Eclipse View for Java Enterprise

Compare this view with the view available in the Anypoint Studio bundled application:

Fig 6 — Anypoint standard view

Managing your Data

Let’s go through some installed plugins, in particular Data Management plugin tool.

As a recall, The Eclipse Data Tools Platform for Eclipse, provides extensible frameworks and exemplary tools, enabling a diverse set of plug-in offerings specific and particular data-centric technologies.

Select the corresponding view and click Open:

Fig 7 — Eclipse Data Source Explorer view

Click on Database Connections, you will see many available Connection profiles to manage your preferred database inside Eclipse. You can also make some SQL queries:

Fig 8 — Eclipse Database Connexion Profile

This is interesting when you use a DB connector inside Anypoint Studio and test your data.

As you can see in this view with the bundled version of Eclipse, you have access to the all Java environment tools to manage your projects. This can include the Maven build tool if you want to develop your Mule integration project and integrate harmoniously to some Java framework like Spring Boot, or if you want to use Spring Beans as Flow components, or Spring Application Context, or use some EJB components and take advantage of the available wizard like JPA (see upper in the Eclipse view).

Let’s add some useful plugins in our Eclipse IDE before integrate Mule ecosystem.

Enhancing your build cycle with M2Eclipse for Maven

One of the most useful ways to manage your Maven project and Mule project is via the M2Eclipse Eclipse plugin.

M2Eclipse is one of the major plugins used to develop maven projects inside Eclipse, and allows execution of Maven goals and manages Maven dependencies.

It is different compared to the standard maven-eclipse-plugin, which is a Maven plugin that attempts to manage/modify Eclipse project files to account for Maven dependencies.

M2Eclipse plugin for Eclipse will be very useful for your Anypoint projects specifically in an OPS phase, in the deployment life cycle for your project on CloudHub, and if you need to apply some specific deployment features using the Mule Maven Plugin, illustrated bellow:

Fig 9 — Managing your build life cycle with Maven plugin for Mulesoft using M2Eclipse plugin

With this Eclipse plugin you can utilize your own Maven project and make use of a useful archetype:

https://maven.apache.org/archetype/ma...

Now, we will explore this topic of Maven archetype in more detail. This archetype is very useful if you want to standardize your Mule assets and project, but for now let’s uncover how to install and configure it.

Click on Install New Software and fill in the work with input text the following URL https://download.eclipse.org/technology/m2e/releases/latest/ as shown bellow:

Fig 10 — Installing M2Eclipse Eclipse using Eclipse repository update

Check the M2E — Complete Development Kit checkbox and M2E — PDE Integration and click Next two time and Finish to launch the plugin installation.

Restart your Eclipse installation to finalize your installation.

You can check the installation of this plugin using the About Eclipse option menu:

Fig 11 — Checking the m2Eclipse post install

Supporting OpenAPI specification inside Anypoint Studio

Often in the development of our APIs, we need inside an enhanced editor to specify and support OpenAPI specification. For a Java developer you may want to consider the rich capabilities of both Swagger-OpenAPI version 2.0 and OpenAPI version 3.0.

OpenAPI (Swagger) Editor is a tool that supports an OpenAPI specification and is available in the Marketplace of Eclipse and will cool features :

Fig 12 — Installing OpenAPI Swagger Eclipse plugin

OpenAPI comes with another plugin that you can install free of charge, KaiZen OpenAPI Editor for Eclipse. This is available in the Eclipse store and gives you the ability to model, document, visualize, test and generate code from your API, inside your Eclipse IDE.

Restart your IDE, and you will have access inside the view to all the features of this complete OpenAPI editor plugin:

Fig 13 — OpenAPI View after plugin installation

Here as an example of the OpenAPI editor in action with an OpenAPI generated inside API Designer and imported as a project inside Eclipse:

Fig 14 — OpenAPI Editor sample inside Eclipse

Managing your code Review

Finally, we conclude our tour of Anypoint Studio Eclipse tools. SonarQube is a useful tool for managing our code review process inside of our MuleSoft projects, which is as you know a very critical for project success, specifically if you develop some Java connector inside your flow diagram.

Here a capture of this plugin available inside Eclipse Marketplace:

Fig 15 — SonarLint installation

Here the dedicated SonarQube view available after installing the plugin:

Fig 16 — SonarQube install view

Int he next part of this series, we will develop a special in depth tutorial to explain the steps to use this SonarQube plugin in our Anypoint Studio daily life project for Devops. It’s important to note that Anypoint API Governance is also a component of the Anypoint Platform that enables you to apply governance rules to your APIs as part of the API lifecycle. You can use this option to improve your organization’s API quality and identify conformance issues in published API specifications and take steps to resolve them.

Now that we have finalized the plugins installation in our Eclipse installation process, it is time now to proceed to the installation of Anypoint Studio plugin inside our Eclipse bundled environment.

Installing Anypoint on the Eclipse bundled version

We conclude our install by installing Anypoint Studio inside our Eclipse installation.

Eclipse plugin version of Anypoint Studio: Read more about installing Anypoint Studio as an Eclipse Plugin.

Click on Help > Install new software in the Eclipse menu and fill the following link update: http://studio.mulesoft.org/r6/plugin . Then, check the following options as illustrated below:

Select the following components :

Fig 17 — Choosing and installing Anypoint components inside Eclipse 1/2

Click Next

Fig 18 — Installation of Anypoint 2/2 inside Eclipse Final step

NOTE: Sometimes there is some incompatibility when you try to install specific features of Anypoint Studio, please check the version of your Eclipse version that you use and consult the requirements of your Anypoint Studio distribution in the available MuleSoft documentation.

Click Next, accept the terms of the license agreement and Finish to finalize the installation and restart your Eclipse installation. Your new Eclipse customized and bundle with Mule components is now ready to Go !

Click on the Eclipse icon to start your new Mule Anypoint Studio Eclipse environment:

Fig 19 — Eclipse Anypoint Studio bundled after installation

As you can see, the Mule perspective is enriched with the other perspective that we have installed before.

To validate our specific Mule Studio bundle I will create a Maven project using the https://github.com/kloudtek/mule4-api-archetype, which is a Mule 4 API project, using APIkit:

Fig 20 — Creating a Mule project from a Maven archetype

Click Next to fill the Group Id and Artifact Id Maven project:

Fig 21 — Filling the POM information using the Mule Maven archetype

Click Finish and click Enter to the following message inside your Mule console:

Fig 22 — Generate your Maven Mule project inside the Mule terminal

Your first API Anypoint project is generated, and you can begin to use your new customized environment:

Fig 23 — Generated Mule project

To conclude

We have completed our customized version of Anypoint Studio using the most useful of plugins that assist you in the life cycle development of your Mule Project.

We will continue in our future articles how we can enhance and give more fun our Anypoint Studio bundle by creating some specifics archetype for Maven projects.

Enjoy your Mule coding and stay tuned !

Resources

https://github.com/RepreZen/KaiZen-OpenApi-Editor

Installing Mule Studio via Update Site or Eclipse Marketplace

--

--