-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add required properties for expansion in the build ConfigSource #14809
Conversation
/cc @rmanibus |
d0115d5
to
4d638ec
Compare
Thank you very much, I think this will be really useful at least for build time config properties. The problems with settings that properties in application.properties are :
There is really something with quarkus:dev, many times It would have been useful to execute other tasks / plugins around. Maybe we can advocate on maven side to implement some kind of "custom phase" ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @radcortez, thanks! A little testcase with a non-quarkus.
property in the pom would be good to add though.
We should add the same in Gradle, btw. |
How would that work @rmanibus ? |
@aloubyansky We could also imagine to give it a rank, for example when this phase is invoked execute all phase before compile. |
Would you mind sketching an example pom config? I guess in the dev mojo we could try looking for plugins configured for let's say |
A typical use case would be to use to invoke docker plugin to start a dB and then inject some data with dbunit plugin. I will draft something about that ! |
This maybe related https://groups.google.com/g/quarkus-dev/c/EQpAI9kBrGk/m/URMR8OibBAAJ |
@aloubyansky in my reproducer regarding this issue, running quarkus:dev will fail because it can not expand quarkus.container-image.tag even if it's not formally required to start the Dev mode. I think we managed to pass this by setting a default value that get overridden by the git plugin, so the branch is wrong during quarkus dev but it has no impact because it is not used. I think it would be cleaner to execute everything before compile when running quarkus:dev Thanks for the link, I will take a look ! |
This is very tricky, because the amount of combinations and plugins is huge and you have no idea which ones the user wants to execute or not from our perspective. It would have to be the user to state that somehow.
Yes, that is one way to do it. I usually set all the properties I'm going to need in the properties section of the POM anyway, even with empty values, just because these plugins generated properties are not recognised by the IDE and they don't have auto completion :) |
@radcortez do you have plans to add a test or should we merge as is? |
Yes, I'll add some in the evening. Is that fine for the Monday release, or do you need it earlier? |
integration-tests/maven/src/test/resources/projects/property-expansion/pom.xml
Show resolved
Hide resolved
Perfect @radcortez, thanks! |
Great. I didn't do that before, because without the fix the build would just fail and I thought it was sufficient :) |
Rebased. |
While this adds any required property for expansion, there are some situations we cannot really control:
quarkus:dev
we don't have any generated expansion property available, so you still get the error. In this particular case, we can discuss if we need to eagerly initialize the ConfigRoot for the ContainerImage, since it should not be required inquarkus:dev
.%dev
profile.