GOAL
Install a provided patch fix on an existing installation of Mule products. IMPORTANT: Patches are created for a specific release of a product. Don't try to use a patch for a version with another product version. That could lead to instabilities and hard to debug issues.
PROCEDURE
Patching Mule Runtime or API Gateway standalone instances
-
Partial patches (SE-NNN-X.Y.Z.jar or SEC-NNN-X.Y.Z.jar)
Partial patch is only a description of the type of patch in which only some files need to be overridden vs a full module replacement (see Full module patch)
- Copy the patch jar file to {MULE_HOME}/lib/user
- Restart the instance to make it pick up the patch.
-
Full module patch (mule-AAA-BBB-X.Y.Z.jar)
- Replace the original jar file with the one provided in the folder {MULE_HOME}/lib/mule
- Restart the instance to make it pick up the patch.
Patching a Mule Plugin
NOTE: Ensure that the instance was successfully started at least once before executing this procedure
- Stop the Mule runtime.
- Backup the directory {MULE_HOME}/plugins/mule-plugin-AAAA_NNNN-X.Y.Z and remove it (current expanded directory of the plugin).
- Paste at {MULE_HOME}/plugins/ the new patched plugin as it is (e.g.: mule-plugin-weave_A.AA-X.Y.Z-SE-NNNN-dist.zip). When Mule starts it should expand that directory.
- Restart the Mule runtime.
Patching DataWeave
NOTE: Ensure that the instance was successfully started at least once before executing this procedure
- Download the DataWeave patch .zip file
- Inside the MULE_HOME/lib/user folder, delete (or move to a temp file) any existing patches. Then copy/paste in the mule-ee-distribution-standalone jar file.
- Inside the MULE_HOME/plugins folder, delete (or move to a temp file) any existing mule-plugin-weave-*-dist.zip. Then copy/paste the mule-plugin-weave-3.9.5-20210419-dist.zip file included in this patch. Do not unzip the file.
- Restart Studio
- Run any project
- After the project deploys, look in the console and search for “data-mapper-plugin.” Under “data-mapper-plugin”, you should see the name of your patch if it was successfully installed. For example, if you installed the patch, “mule-ee-distribution-standalone-3.9.5-20210322-patch.jar”, you should see the below in the console. This means your patch was successfully applied.
INFO 2021-05-18 14:40:14,159 [main] com.mulesoft.mule.plugin.manager.MulePluginManager: Registering plugin: mule-plugin-weave-3.9.5-20210322-dist
Patching with Maven (Only when running Mule embed. Example: Running tests with Maven)
- Install the file in the local repository:
mvn install:install-file -Dfile={patch-file-name}.jar -DgroupId=com.mule.support -Dversion=1.0 -DartifactId={patch-name} -Dpackaging=jar
- Reference the library (using the information supplied in the previous step) in your project's pom.xml making sure it is the first dependency in the list of dependencies.
Patching a Mule Runtime in Anypoint Studio 3.5 or greater
Note: Studio version refers to the Anypoint Studio version, not the runtime version used to run your application.
To install patches for a specific Mule Runtime version inside Studio
- Identify the directory within the Studio installation where your runtime is installed. It will follow the pattern {STUDIO_HOME}/plugins/org.mule.tooling.server.{MULE_VERSION}.ee_n.n.n.nnnnnnnnnnnn, where {STUDIO_HOME} is where Studio is installed, {MULE_VERSION} is the Mule Runtime version (eg 3.8.3), n.n.n.nnnnnnnnnnnn is a release tag. If there are more than one directory with the same {MULE_VERSION} but different release tag then select the one with the greater release tag. Example: org.mule.tooling.server.3.8.3.ee_6.2.2.201701201826.
- Find the {MULE_HOME} subdirectory by adding /mule to the directory found in the previous step. For example for the previous case: {MULE_HOME} = {STUDIO_HOME}/plugins/org.mule.tooling.server.org.mule.tooling.server.3.8.3.ee_6.2.2.201701201826/mule
- Copy the patch jar file to {MULE_HOME}/lib/user
- Restart Studio
For other kinds of patches follow step 1 and 2 above to find the {MULE_HOME} directory and then follow the instructions for standalone instances.
Patching Eclipse
(without Studio plugin)
- Copy the patch jar file to a folder of your choice.
- Right-click on the project and select Build Path -> Configure Build Path.
- Select the Libraries tab.
- Click on Add External JARs...
- Select the file copied in step 1
- Go to the Order and Export tab.
- Select the library added in step 5 and move it to be on top.
Patching APIKit
Please refer to the How to apply patches to APIKit article for this product.
Appendix:
Deprecated in favor of newer versions. Only applicable if you use an old version of Studio:
Patching a Mule Runtime in Studio 3.4
- Copy the patch jar file to {STUDIO_HOME}/plugins/org.mule.tooling.server.{RELEASE_VERSION}/mule/lib/mule replacing the current one.
Important: patches for Studio cannot be partial. (I.e. it needs to be the full module/transport). If you have a JAR file that is not the full module/transport (mule-*.jar) please contact MuleSoft Support.