code.quarkus.io
code.quarkus.io copied to clipboard
Add quarkus-resteasy-reactive as dev mode only dependency (for Dev UI)
As I was made aware today after raising this issue it's possible to add dependencies only for dev mode. It would be good if the code generator does that for everyone, that does not use quarkus-resteasy or quarkus-resteasy-reactive.
For gradle it would be a simple entry
dependencies {
// ...
quarkusDev("io.quarkus:quarkus-resteasy-reactive") // or the non reactive what ever you think fits best
// ...
}
Why resteasy reactive ?
You mean vertx-http to have enough for devmode ?
I agree it would be nice to document This but doing it by default I'm not a fan off.
@aloubyansky whats the maven equivalent of this feature?
vertx-http should be enough.
ah if vertx-http is enought, then I meant that.
@aloubyansky what is the maven equivalent of gradles builddev dependency?
There is no equivalent really. The closest scope would be provided.
Ok - that's what I thought.
That's a shame.
So the closest approach in maven would be to add vertx-http in a profile one can optionally enable when running devmode ?
Wondering if could make it so that if certain property is set we would honor a profile with additional dependencies?
We already have -Pnative for Maven. We could as well add -Pdev.
So mvn -Pdev would be enough to launch in dev mode
So
mvn -Pdevwould be enough to launch in dev mode
couldn't we keep mvn quarkus:dev but make the dev profile active from the plugin itself?
No, that'll be too late.
@aloubyansky can I close this?
I guess we could still consider introducing -Pdev profile in the generated projects.
Or maybe we should just document the workaround for this edge case?
in https://github.com/quarkusio/quarkus/pull/32396 we guide user to add the dependency. i think we should see if that is not sufficient rather than add yet-another profile to all projects.
@aloubyansky actually; what would the -Pdev profile actually do in pom.xml ? would it be different or same from quarkusDev in gradle with respect to classloaders/dependency behavior?
It could add dev mode-specific config, such as properties, dependencies, resource directories, etc.
@aloubyansky I get that - but we would want as little extra needed in the build files hence I was curious what it would have?
But more importantly is quarkusDev(gav) in gradle going to have any/signficant different behavior than -Pdev with maven when it comes classloading/dep behavior?
@aloubyansky I get that - but we would want as little extra needed in the build files hence I was curious what it would have?
It could define the default build goal, so the dev mode could be launched with -Pdev (from the app module), and if we want to make sure quarkus-vertx-http is always around we would add it as a dependency in that profile.
But more importantly is quarkusDev(gav) in gradle going to have any/signficant different behavior than -Pdev with maven when it comes classloading/dep behavior?
No, it would be the same.
one downside of requiring profile here is that i.e. run from IDE's devmode would not see it.
not sure if that's reason enough to not do it but it is something that would have to documented/explained as difference.
Saw today in a Live-Demo by @kdubois where exactly this was the issue.