Open andreas-eberle opened 3 years ago
/cc @evanchooly
IMHO I don't think you can add dependencies dynamically like that, that's why we have the resteasy-jackson
and rest-client-jackson
extensions, for example.
In this case I think the best is to introduce a quarkus-kotlin-jackson
extension
@aloubyansky might have some thoughts on this :)
In general I agree with George, we shouldn't go too far and start magically adding dependencies to the application just because we can :).
If we however had something like George mentioned in the quarkus-kotlin-jackson
extension, we could engage it automatically if the quarkus-jackson
and quatrkus-kotlin
where part of the application.
Right, in can only be done if there is a corresponding Quarkus Kotlin extension.
An alternative way to the RR Kotlin support modelling it would be to create Kotlin area-specific (e.g. jackson, etc) extensions that would be configured with a condition on the presence of a specific artifact on a classpath. Then quarkus-kotlin
extension would add optional dependencies on those Kotlin area-specific extensions. So, if an app includes quarkus-kotlin
extension and artifacts satisfying one (or more) Kotlin area-specific extensions are present, those Kotlin area-specific extensions would be enabled automatically.
Thanks @aloubyansky for the insight!
So let's close this for now, but keep in mind what is now possible due to your improvements in the bootstrap process
Sorry, I'm not sure if I did understand all the deep down Quarkus details...
com.fasterxml.jackson.module:jackson-module-kotlin
? And then you could wire this up?Sorry, I'm not sure if I did understand all the deep down Quarkus details...
- Do you agree that this should be added automatically?
IMO, that's a reasonable feature request.
- ~Did I get it right, that there is a technical limitation that does not allow to do it?~
In traditional Maven/Gradle world, it is. In Quarkus 2.0 we introduced a Quarkus bootstrap feature that should allow us make it possible.
- So we would need a quarkus-kotlin-jackson extension that only contains the dependency to the
com.fasterxml.jackson.module:jackson-module-kotlin
? And then you could wire this up?
This could be a way. I think we should review the whole Kotin dependency model from this perspective to have a bigger picture.
Should we keep this issue open then? I mean, since it seems to be a reasonable request and technically possible. It looks to me this "only" requires clarification on how Quarkus wants to handle Kotlin specific dependencies over all. Therefore I think it would make sense to have this issue reopened and maybe linked to an issue that focuses on the Kotlin dependencies discussion.
Isn't this issue the same as https://github.com/quarkusio/code.quarkus.io/issues/426 ?
Ah, it's different repo.
The code.quarkus one should be closed, imo.
Yes, I'd agree to keep it open.
I agree, a fix of this issue would make https://github.com/quarkusio/code.quarkus.io/issues/426 obsolete.
https://github.com/quarkusio/quarkus/issues/23342 is another manifestation of this.
I wonder if I should add a quarkus-resteasy-reactive-jackson-kotlin
extension that will get enabled automatically if quarkus-resteasy-reactive-jackson
and quarkus-kotlin
are present...
Description
When a Quarkus project contains the quarkus-kotlin and a jackson extension, the dependency
com.fasterxml.jackson.module:jackson-module-kotlin
should be added automatically. This extension allows jackson to create Kotlin specific type like data classes.I think if a project uses Kotlin & Jackson, this dependency should automatically be added alongside the jackson dependency.