Shading Libraries

DevKit is compatible only with Studio 6 and Mule 3. To build Mule 4 connectors, see the Mule SDK documentation.

DevKit version 3.5.3 and later supports the use of shading (renaming) JAR files using the Apache Maven Shade Plugin from your project’s pom.xml file.

If needed, you can add a dependency in your pom.xml files so that your JAR file names do not collide with those in Mule. For those scenarios, we strongly recommend that you use the same version of the library as Mule does, and if is not possible, then change your library to another one. If you still need a custom library that collides with Mule, then shading can work for you.

To add the shading plugin to your connector’s pom.xml file:

  1. Add the custom JAR to the connector using the pom.xml file dependencies.

  2. Rename the packages of the library to the new JAR to avoid collisions.

The following example shows the dependencies for a groupId of org.some.library and an artifactId of custom-artifact-id:

       <version>2.0</version> <!-- version is in connector's JAR -->

The following example shows the use of the plugin for shading artifacts:

       <!-- custom shade configuration -->
  <!-- Other plugins -->

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub