Nav

Introduction to Mule 4: Packaging Applications

Application Structure

There are few important changes to how Mule applications are packaged in Mule 4. Mule applications are now packaged as a JAR and have a different structure. You can use the Mule Maven Plugin to easily package your source code into this structure.

Location Description

META-INF/mule-artifact/mule-artifact.json

Descriptor for your Mule application (see [mule-artifact.json]).

META-INF/mule-src/yourapp/

An optional location for your source code.

repository

A repository for all your application’s dependencies in Maven layout. This includes all your connectors for your app. For example, repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar

yourapp.xml

Your Mule XML code.

mule-artifact.json

Mule 4 applications include a mule-artifact.json file in META-INF/mule-artifact/. This describes your app, configuration settings, the required Mule version, and the class loader configuration.


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "configs": [
    "ch-usage-sync.xml"
  ],
  "redeploymentEnabled": true,
  "name": "ch-usage-sync",
  "minMuleVersion": "4.0.0",
  "requiredProduct": "MULE_EE",
  "classLoaderModelLoaderDescriptor": {
    "id": "mule",
    "attributes": {
      "exportedResources": []
    }
  },
  "bundleDescriptorLoader": {
    "id": "mule",
    "attributes": {}
  }
}

Mule Maven Plugin

The Mule Maven Plugin in Mule 4 packages your app into the required format and enables you to deploy it into your target environment. Studio 7 will automatically add the plugin to your pom.xml. See the Mule Maven Plugin documentation for information on how to use it to deploy apps.