Describe the bug
When running quarkus:dev from Maven and some dependency is in an activated profile, this dependency is not picked up. On the contrary, when running the packaged -runner.jar, this dependency is indeed activated.
Expected behavior
Dependencies should be picked up, however they get activated.
Actual behavior
Dependencies defined in an activated Maven profile are not picked up.
To Reproduce
Steps to reproduce the behavior:
Move one dependency from the top-level <dependencies> in a profile; I removed the quarkus-jdbc-h2 and added the following profile:
<profile>
<id>xxx</id>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>
</dependencies>
</profile>
Try the following:
Start quarkus:dev, activating the profile:
mvn compile quarkus:dev -Pxxx
Quarkus reports:
INFO [io.quarkus] (main) Installed features:
[agroal, cdi, hibernate-orm, narayana-jta, resteasy]
Observe that jdbc-h2 is not activated!
Now package and run the runner:
mvn package -Pxxx
java -jar target/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
Quarkus reports:
INFO [io.quarkus] (main) Installed features:
[agroal, cdi, hibernate-orm, jdbc-h2, narayana-jta, resteasy]
Configuration
None - using the pristine source as downloaded from code.
Screenshots
N/A
Environment (please complete the following information):
uname -a or ver: Linux wanderer 4.15.0-64-generic #73-Ubuntu SMP Thu Sep 12 13:16:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linuxjava -version: openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
Additional context
N/A
@aloubyansky perhaps this is something you can take a look at?
Yes, this issue has been reported before. Please watch the status of #3702. I am going to close this one as a duplicate. Thanks for reporting.
Thank you @aloubyansky , I wasn't sure it was due to the same reason!
Hi @aloubyansky ,
I can see that #3702 is closed, but this is not solved; tried with 1.1.0.Final - apparently the solution for 3702 was incorporated in 1.1.0.CR1.
I have updated the description, shall we reopen this?
Thank you!
Hi @nikospara,
sorry, reviewing this issue I see that my first assessment of it was not entirely accurate. It's not a duplicate of #3702. They do look identical but their nature is different. This issue should in fact be fixed now but not in 1.1.0. Please see #5464.
Thank you, @aloubyansky , will keep an eye on it.
Still happening with 1.2.0, which has 5464 merged.
Is it an issue with 1.3.0.Alpha1 as well?
Hi @geoand, sorry for the delayed response. YES, I get the same behavior with 1.3.0.Alpha1 (compiled locally).
Okay thanks for checking.
@aloubyansky is this something you want to check?
Sure, I was going to.
Thanks!
I can reproduce it.
@nikospara I believe https://github.com/quarkusio/quarkus/pull/7154 fixes your issue. The PR also includes a test for it. And it's now merged in master. If there is a chance you can try it, please, do and let us know how it worked for you. Thanks.
Hi @aloubyansky, again sorry for the late reaction. Will check ASAP (tomorrow probably) and let you know. Thank you!
Hello again @aloubyansky. Yes, I confirm it is working with the latest master.
Excellent, thanks @nikospara