Skip to content
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 resteasy capability #5142

Closed

Conversation

lburgazzoli
Copy link
Contributor

In camel-quarkus we do enable some features or behaviors according to
the presence of resteasy and as today the conditions is the presence
of the quarkus-resteasy extension (checked by lookgin at what features
are on the classpath using FeatureBuildItems).

This PR introduces a new capability "resteasy" that can be used by our
code instead of basing our conditional on extension names.

@lburgazzoli
Copy link
Contributor Author

I'm not 100% sure about this implementation as RESTEasy itself relies on capabilities to enable/disable some behaviors.

@@ -56,7 +56,7 @@ public ResteasyStandaloneBuildItem(String deploymentRootPath) {

}

@BuildStep()
@BuildStep(providesCapabilities = Capabilities.RESTEASY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason that both this one and the providesCapabilities on build are needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact no, I've annotated both as both the build step are supposed to provide a resteasy's FeatureBuildItem so I've replicated the behavior to the related BuildStep annotation.

My first tough was to add a BuildProducer<CapabilityBuildItem> to both the methods and conditionally add the capability but then I noticed that one of the two builder step are also leveraging capabilities so adding a build producer could trigger a cycle.

An option would be to add an additional BuildItem to signal that resteasy is in use and add the capability.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should get rid of 'providesCapabilities' and just use a normal build item for it, the reason why it is treated specially is largely for historical reasons.

@stuartwdouglas
Copy link
Member

Superseded by #5195

@lburgazzoli lburgazzoli deleted the resteasy-capability branch November 7, 2019 08:03
@gsmet gsmet added this to the 1.1.0 milestone Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants