Creating a Mule project in Eclipse

2019-01-19 07:55发布

问题:

I have started working with Mule. I am working with Mule Studio. This looks good. But when I want to create a Mule project in Eclipse I am struck. Please suggest me how I can create a Mule project in Eclipse.

回答1:

Option 1: With Mule IDE Plugin for Eclipse.

You can use the Mule IDE plugin from eclipse. This helps in creating the mule project in eclipse.

To add plugins please start eclipse and navigate to help->install new software -> Add site and select the artifacts presented

Add muleide (mule plugin) - http://dist.muleforge.org/mule-ide/updates/3.4/

Then restart Eclipse after the plugin installation and You can create a Mule Project under the New Project option.

Option 2: Without Mule IDE. With Maven and Eclipse.

Open Command prompt. Run the following Maven command to create a Mule project.

mvn org.mule.tools:mule-project-archetype:3.3.0:create -DartifactId=MySampleMuleProj -DmuleVersion=3.3.0

Then run the follwoing commands.

mvn clean compile
mvn eclipse:clean eclipse:eclipse

After this open Eclipse IDE Import this project into the eclipse workspace.

Note: Use Import "Existing Maven Project" option for importing this project.

To run the Mule project in eclipse forllow the below steps.

1. Goto Run -> Run Configurations in eclipse and select Java Application.
2. Click on New launch configuration and enter name of the configuration(for ex. MyMuleProj).
3. Select MyMuleProj as a project and Main class "org.mule.MuleServer".
4. Click on Arguments tab and enter Program arguments "-config src/main/app/mule-config.xml".

You can see the Mule project up and Running.

:) Happy Learning.



回答2:

You can import your existing project in eclipse or if you've a Maven project, create an Other project and select Maven-> Checkout Maven Projects from SCM or create a Java project. There are so many ways to do it.

I run my mule project in eclipse through MuleServer class and passing mule-config.xml as program argument.



回答3:

Actually Mule Anypoint Studio is built on Eclipse. If you want to import any maven project, then do this : mvn clean compile mvn eclipse:clean eclipse:eclipse