Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kotlin-reflect to dependencies #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sghill
Copy link
Contributor

@sghill sghill commented Jun 27, 2024

Hi folks! What do you think about adding kotlin-reflect as a dependency?

I have a custom plugin that needs jackson-module-kotlin, which in turn requires kotlin-reflect. Today I can build up this dependency tree below, but unfortunately I get a kotlin.jvm.KotlinReflectionNotSupportedError: Kotlin reflection implementation is not found at runtime. Make sure you have kotlin-reflect.jar in the classpath

+ my plugin
     + jackson2-api
     + jackson-module-kotlin
     + okhttp-api
     + kotlin-reflect

By adding kotlin-reflect to okhttp-api, the exception goes away. The dependency tree now looks like:

+ my plugin
     + jackson2-api
     + jackson-module-kotlin
     + okhttp-api
         + kotlin-reflect

This works great for me and I think is a practical solution, but I can also see how it may be better to split off a kotlin-api plugin instead. Happy to do that if it's preferred. For what it's worth, my only uses for kotlin involve okhttp and jackson.

Testing done

Published my version and ran with it locally, proving the runtime exception no longer happens.
Existing tests pass.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@sghill sghill requested a review from a team as a code owner June 27, 2024 07:05
@jtnord
Copy link
Member

jtnord commented Jul 1, 2024

This works great for me and I think is a practical solution, but I can also see how it may be better to split off a kotlin-api plugin instead. Happy to do that if it's preferred. For what it's worth, my only uses for kotlin involve okhttp and jackson.

as there are now a few plugins using kotlin I would think a new modular set of API plugins containing the kotlin runtime / extras should be introduced (similar to the AWS SDK) so that this and other plugins can depend on them.

Obviously this would not work if kotlin introduces breaking changes - but it strives to maintain backwards compatibility but also says it can break things, so this may not be a good option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants