Loading third-party dependencies into KC #10496
Replies: 6 comments 14 replies
-
When building a fat jar and adding that as a custom provider, I get the following error:
|
Beta Was this translation helpful? Give feedback.
-
Please check the server developer guide. In essence just copy additional dependencies to the providers directory |
Beta Was this translation helpful? Give feedback.
-
This is what the dependency tree looks like for the Kinesis library:
are people really expected to find the relevant dependencies for their usage of the library and then upload the jars for each of those manually? Doesn't seem like a practical solution at all. |
Beta Was this translation helpful? Give feedback.
-
@stianst I found this similar issue to mine with the fat jar from older versions: https://issues.redhat.com/browse/KEYCLOAK-4428?workflowName=GIT+Pull+Request+workflow+&stepId=6. Here the solution was to include keycloak-services in the |
Beta Was this translation helpful? Give feedback.
-
@DGuhr @stianst I think we have a pretty good use case to start thinking about how to deal with providers using 3rd party dependencies. IMO, if we can think/build something on top of it we should be able to solve most of the issues we are facing now when migrating providers from Wildfly:
|
Beta Was this translation helpful? Give feedback.
-
In
which copies the jars of the libraries that I am referencing and their dependencies into the jars directory excluding everything by keycloak which should already be present (
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm new to Keycloak and we just switched to version 17, but we had the same issue in the previous version. I am working on emitting user change events to AWS Kinesis, but I notice the following errors when running the code:
java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentialsProvider
. This happens with other classes as well. I am importing the Kinesis dependency using Gradle in the following way:AWSCredentialsProvider
is a dependency under theimplementation 'com.amazonaws:amazon-kinesis-producer:0.14.10'
library so I would expect not to have to import anything else in order to support that. I wouldn't have to if this was a Spring Boot application.In a similar way, I am struggling getting Kotlin support. Ideally I would want it to be covered by
build.gradle
and not to have to set up providers specifically for all the different dependencies I might need or the dependencies those dependencies need. Is there something I am missing during the packaging of the jar that is causing this issue or are we fundamentally expected to provide the jars for each dependency and third-party dependencies manually?For Wildfly I had to set up a script like this:
and then Kotlin was supported, but not the Kinesis library and its dependencies. Once I added the Kinesis jar, still the dependency that
AWSCredentialsProvider
came from wasn't supported. If we have to add all the jars for all the dependencies separately, that would bring in a lot of work as the third party dependencies can be "endless".Beta Was this translation helpful? Give feedback.
All reactions