Uncaught server error: java.lang.NoClassDefFoundError implementing a custom provider for an external mysql database

I leave the solution i had with gradle 7.4.0 and keycloak version 21.1.1

build.gradle
plugins {
id(“com.github.johnrengelman.shadow”) version “7.1.2”
}

apply plugin: ‘com.github.johnrengelman.shadow’

shadowJar {

dependencies {

// list of the dependencies needs to be included in the fat jar
include(dependency(“com.xxxxx:$Version”))

}

}

docker file
in the gradlew command added the shadowJar
and copied the xxxxx-all.jar file to the binaries of the keycloak with the name xxxxx.jar in order to have the jar with the same name with the custom provider.

Thank you for your responses.