quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.88k stars 2.71k forks source link

Allow to add specific dependency in dev mode #34153

Open apupier opened 1 year ago

apupier commented 1 year ago

Description

For context, I would like to add camel-quarkus-debug dependency automatically as it allows automatic configuration of Camel Route Debugging capabilities. Currently the way (the workaround) is to have a specific profile with this dependency that I specify when launching dev mode. It gives something like: mvn quarkus:dev -Pcamel.debug and a specific profile just for the debug inside the pom.xml

For reference: https://github.com/apache/camel-quarkus/issues/3876

advantages:

drawbacks:

discussion started on Zulip: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Adding.20a.20specific.20dependency.20only.20in.20dev.20mode/near/366074605

Implementation ideas

something like: mvn quarkus:dev -Dquarkus.dev.extras=camel-quarkus-debug that is automatically adding the dependency.

quarkus-bot[bot] commented 1 year ago

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

essobedo commented 1 year ago

Will it cover transitive dependencies or the dependencies must be added manually to the command?

I mean, camel-quarkus-debug depends on camel-quarkus-management, will we need to add both to the command or only camel-quarkus-debug ?

apupier commented 1 year ago

Iit should include transitive dependencies

mstahv commented 4 months ago

Subscribe.

Context: we have "forever" had developer tooling in Vaadin apps. Like in the description, we have been handling that with a profile (or technically, we have had them there by default and then instructed people to use "production" profile). Especially for new users without previous Vaadin experience, this is a PITA and they usually fail doing a proper deployment. Quickly skimming through the description, this would be great for Vaadin to "do things right".

With Spring Boot I recently created a PoC by adding a separate main method to src/test/java (like the suggest to do with Testcontainers if used for dev mode db configuration). This kind of leaks some class path entries not relevant for dev mode (but technically only for testing), but so far in my tests that also work pretty well. I wonder if that kind of compromise is possible with Quarkus.

Edit: Adding potential idea to implement the compromise, didn't test but guessing it might work like with SB. Explicitly defined main method to src/test/java. https://quarkus.io/guides/lifecycle#the-main-method

lordvlad commented 2 months ago

Unless I'm mistaken about your exact use case, quarkus supports that:

https://quarkus.io/guides/gradle-tooling#dev-mode

I use that to configure different smallrye-reactive-massaging providers

# gradle kotlin dsl
dependencies {
    implementation("io.quarkus:quarkus-smallrye-reactive-messaging-kafka")
    quarkusDev("io.quarkus:quarkus-smallrye-reactive-messaging-mqtt")
    testImplementation("io.quarkus:quarkus-smallrye-reactive-messaging-mqtt")
}