Loading

How to override library dependencies in a custom connector

Data pubblicazione: Aug 4, 2025
Operazione

GOAL

On occasion a custom connector may need to use one or more external dependencies that are already contained in the Mule runtime, but whose version is different. While there is a well defined mechanism for achieving this goal in a Mule application, by using the class loader override mechanism, in the case of a custom connector there are a couple of alternatives. These are described below.

Fasi

Option 1: Use shading

This option is based on the Apache Maven Shade Plugin. It is achieved by adding a dependency in the connector's pom.xml file so that the names of the JAR files in question do not collide with those in Mule. This process is described in detail in the documentation, along with examples.
 

Option 2: Use class loader override

Declare the overridden packages using the loader.override property as described in the documentation for a Mule application, but add this property to the plugin.properties file that is located inside the connector project. This will prevent Mule from looking in the parent class loader for all the classes inside the packages that are listed in the loader.override properties.
Numero articolo Knowledge

001114839

 
Caricamento
Salesforce Help | Article