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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public final class Capabilities extends SimpleBuildItem {
public static final String TRANSACTIONS = "io.quarkus.transactions";
public static final String JACKSON = "io.quarkus.jackson";
public static final String JSONB = "io.quarkus.jsonb";
public static final String RESTEASY = "io.quarkus.resteasy";
public static final String RESTEASY_JSON_EXTENSION = "io.quarkus.resteasy-json";
public static final String SECURITY = "io.quarkus.security";
public static final String JWT = "io.quarkus.jwt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void jaxrsConfig(Optional<ResteasyServerConfigBuildItem> resteasyServerCo
}
}

@BuildStep
@BuildStep(providesCapabilities = Capabilities.RESTEASY)
public void build(
Capabilities capabilities,
Optional<ResteasyServerConfigBuildItem> resteasyServerConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

@Record(STATIC_INIT)
public void staticInit(ResteasyStandaloneRecorder recorder,
Capabilities capabilities,
Expand Down