-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow to exclude JAX-RS classes with annotations #15215
Conversation
0f5312c
to
fba16b4
Compare
...nsions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BuildTimeEnabledProcessor.java
Outdated
Show resolved
Hide resolved
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.
Thanks for this work!
I like the idea, but I have a couple hesitations:
- I don't think it will work properly for RESTEasy Classic for anything besides JAX-RS Resources
- If we have support for
IfBuildProfile
, we should also have support forUnlessBuildProfile
...nsions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BuildTimeEnabledProcessor.java
Outdated
Show resolved
Hide resolved
...nsions/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/root/BuildProfileTest.java
Outdated
Show resolved
Hide resolved
@geoand I'm glad that you like the idea 😄 About your remark:
|
Yeah, I saw that. I am just sceptical that some other use case will come along that won't work.
Well, I don't see that actually :P |
OK thanks. If CI has passed on your fork, then go ahead and take the PR out of draft. |
Also, don't forget to squash the commits once the review is done (I can't promise you a timeline for this ufortunately) |
04bec49
to
ba68e3f
Compare
@geoand ok, no problem, meanwhile I squashed my commits |
FYI the test that fails on the CI, doesn't fail on my local machine, maybe it is known as a random failure? |
Most likely it's a flaky test, I'll rerun it |
...nsions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BuildTimeEnabledProcessor.java
Outdated
Show resolved
Hide resolved
ba68e3f
to
4ab150f
Compare
...arc/deployment/src/main/java/io/quarkus/arc/deployment/EagerBuildTimeConditionBuildItem.java
Outdated
Show resolved
Hide resolved
...arc/deployment/src/main/java/io/quarkus/arc/deployment/EagerBuildTimeConditionBuildItem.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveConfig.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java
Outdated
Show resolved
Hide resolved
5156ff8
to
9fb0605
Compare
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.
This is great work, thanks!
Once the doc issues I suggested are addressed and CI finishes, let's merge
And of course we'll need the commits squashed :) |
Co-authored-by: Georgios Andrianakis <[email protected]>
12f88dd
to
c03a357
Compare
Just to satisfy my curiousity, how do you plan to use this feature? |
@geoand done |
@geoand Good question 😄 . This is actually one part of my need, my second need (next contribution if accepted by you, the Quarkus team?) is to be able to manage several artifacts with different classifiers in the same module with the maven plugin, pretty much like when you propose the same artifact but for different target JDK versions. The idea behind is to have the same module in which you have everything mixed but annotated with build time conditions and build your final artifact with different build profiles. You would then be able to create an artifact for 'dev', 'stating' and 'prod' from the same module with one single maven command instead of launching the build command for each profile. |
Understood, thanks for the info |
fixes #15214
Motivation
The idea of this feature is to provide an easy way to include/exclude JAX-RS resource, provider and feature classes at build time by relying on the build time conditions
Modifications:
ResteasyReactiveCommonProcessor#handleApplication
andResteasyServerCommonProcessor#build
depend onBuildTimeConditionBuildItem
to have access to all computed build time conditions.getExcludedClasses
to both extensions to retrieve the list of classes that need to be excludedbuildTimeConditionAware
to both extensions to be able to disable the feature if needed knowing that it is enabled by defaultPreAdditionalBeanBuildTimeConditionBuildItem
to be able evaluate build time conditions before processingAdditionalBeanBuildItem
to avoid a circular dependency.Result
The JAX-RS classes can now be included/excluded thanks to the build time conditions