code.quarkus.io icon indicating copy to clipboard operation
code.quarkus.io copied to clipboard

Add quarkus-resteasy-reactive as dev mode only dependency (for Dev UI)

Open bulldog98 opened this issue 2 years ago • 20 comments

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
   // ...
}

bulldog98 avatar Mar 31 '23 06:03 bulldog98

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?

maxandersen avatar Apr 01 '23 06:04 maxandersen

vertx-http should be enough.

aloubyansky avatar Apr 01 '23 06:04 aloubyansky

ah if vertx-http is enought, then I meant that.

bulldog98 avatar Apr 01 '23 08:04 bulldog98

@aloubyansky what is the maven equivalent of gradles builddev dependency?

maxandersen avatar Apr 01 '23 13:04 maxandersen

There is no equivalent really. The closest scope would be provided.

aloubyansky avatar Apr 01 '23 13:04 aloubyansky

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?

maxandersen avatar Apr 02 '23 08:04 maxandersen

We already have -Pnative for Maven. We could as well add -Pdev.

aloubyansky avatar Apr 02 '23 18:04 aloubyansky

So mvn -Pdev would be enough to launch in dev mode

aloubyansky avatar Apr 02 '23 18:04 aloubyansky

So mvn -Pdev would be enough to launch in dev mode

couldn't we keep mvn quarkus:dev but make the dev profile active from the plugin itself?

ia3andy avatar Apr 03 '23 11:04 ia3andy

No, that'll be too late.

aloubyansky avatar Apr 03 '23 11:04 aloubyansky

@aloubyansky can I close this?

ia3andy avatar Jun 26 '24 08:06 ia3andy

I guess we could still consider introducing -Pdev profile in the generated projects.

aloubyansky avatar Jun 26 '24 08:06 aloubyansky

Or maybe we should just document the workaround for this edge case?

ia3andy avatar Jun 26 '24 08:06 ia3andy

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.

maxandersen avatar Jul 08 '24 05:07 maxandersen

@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?

maxandersen avatar Jul 08 '24 05:07 maxandersen

It could add dev mode-specific config, such as properties, dependencies, resource directories, etc.

aloubyansky avatar Jul 10 '24 07:07 aloubyansky

@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?

maxandersen avatar Jul 10 '24 08:07 maxandersen

@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.

aloubyansky avatar Jul 15 '24 16:07 aloubyansky

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.

maxandersen avatar Jul 17 '24 11:07 maxandersen

Saw today in a Live-Demo by @kdubois where exactly this was the issue.

bulldog98 avatar Jul 18 '24 13:07 bulldog98