The example shows how to create a runnable Jar file with Mule Embedded.
The example uses Mule CE 3.9.0, but it may works with Mule EE, I have not anymore account to EE Repository (for Mule EE you need Mule EE License).
For Mule EE, you need:
-
Include Mule EE license file in src/main/resources.
-
In build.gradle file add user/password for Mule EE repository, update the muleEnterprise flag to true and update muleversion to the desired Mule EE version (see https://github.com/mulesoft-labs/mule-gradle-plugin).
mule.version = '3.9.1'
mule.muleEnterprise = true
mule.enterpriseRepoUsername = 'your-username'
mule.enterpriseRepoPassword = 'your-password'
The Gradle build file uses the the following plugins to create the jar file:
-
Mule Gradle Plugin https://github.com/mulesoft-labs/mule-gradle-plugin
-
Casule Gradle Plugin https://github.com/danthegoodman/gradle-capsule-plugin
##Requirements
a) Java 8+
b) Gradle 4.0+
-
Clone the project
-
Go in the directory
-
Execute
gradle clean microserviceJar
- Run
java -jar build/libs/mule-example-1.0-microservice.jar
You should see in you browser: "Hello World from Mule Microservice"
Contact: Rafael Espino (rafael.espino@gmail.com)