Deployment Descriptor
Mule’s deployment descriptor is a properties file (mule-deploy.properties
) that controls how a Mule application should be deployed. A typical application, however, would rarely need to use many of the configuration properties available in the file, relying instead on defaults.
Mule checks if there is a deployment descriptor file in the application root and uses it if available (it’s optional).
Here’s the list of supported configuration properties in the deployment descriptor:
Name | Description | Default |
---|---|---|
domain |
ClassLoader domain for this application. Typically used to share common libraries between applications and/or to allow use of different library version in applications. Maps directly to |
"default" |
config.resources |
A Mule 2.x-style comma separated list of configuration files for this application. Typical use is to support split configurations declaratively. An alternative is to have a default |
|
redeployment.enabled |
Allows explicitly disabling application hot-redeployment - configuration 'master' file will not be monitored for changes. Dropping a new version of the application archive in the |
Enabled by default |
encoding |
Default encoding, used throughout the application if none specified explicitly on, for example,. a transformer |
UTF-8 |
config.builder |
Configuration builder to use for parsing the application config file. |
AutoConfigurationBuilder |
scan.packages (since Mule 3.1) |
The application’s classpath is no longer scanned for iBeans annotations ( |
Empty by default |
loader.override |
Overrides default class loading. The property value is specified as a comma-separated list of classes, packages, or both. Blocking can also be specified by preceding the classes or packages in the list with a - (dash/minus sign). If a class is specified in the blocking list, its lookup is performed within the application or plugin only, and not in Mule. For further details, see Classloader Control in Mule. |
Empty by default |
Two things to note:
-
Classloader domains can feature different versions of the same library for different sets of applications.
-
Unless otherwise instructed, the default domain is used. You can specify a custom domain using the
domain
property in the application deployment descriptor.
Options
An application may also contain a mule-app.properties
file in the application root (right next to the mule-deploy.properties
file). The mule-app.properties
file is the place to put any custom properties for the application. Mule will make them available in the registry and they can be accessed in two ways:
-
At application startup in the configuration file. Use a
${foo
} placeholder (or any Mule expression which can get to the registry) to lookup afoo
value. -
In the code (for example, by implementing
MuleContextAware
). A registry ref is then accessible throughmuleContext.getRegistry()
. You can then use any suitable lookup method on this instance.
Classloadling in Mule
For details on classloading in Mule, including a diagram of the Mule classloading architecture, see Classloader Control in Mule.