Skip to content

Commit

Permalink
Merge pull request #22609 from geoand/#22605
Browse files Browse the repository at this point in the history
Move RESTEasy provider registration as unremovable beans to common module
  • Loading branch information
geoand authored Jan 5, 2022
2 parents 99049e5 + 588bab2 commit 4e9dea2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ ResteasyInjectionReadyBuildItem setupResteasyInjection(
JaxrsProvidersToRegisterBuildItem setupProviders(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
CombinedIndexBuildItem indexBuildItem,
BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,
BuildProducer<UnremovableBeanBuildItem> unremovableBeans,
List<ResteasyJaxrsProviderBuildItem> contributedProviderBuildItems,
List<RestClientBuildItem> restClients,
ResteasyConfigBuildItem resteasyConfig,
Expand Down Expand Up @@ -260,8 +261,14 @@ JaxrsProvidersToRegisterBuildItem setupProviders(BuildProducer<ReflectiveClassBu
"org.jboss.resteasy.plugins.providers.jsonb.AbstractJsonBindingProvider"));
}

return new JaxrsProvidersToRegisterBuildItem(
JaxrsProvidersToRegisterBuildItem result = new JaxrsProvidersToRegisterBuildItem(
providersToRegister, contributedProviders, annotatedProviders, useBuiltinProviders);

// Providers that are also beans are unremovable
unremovableBeans.produce(new UnremovableBeanBuildItem(
b -> result.getProviders().contains(b.getBeanClass().toString())));

return result;
}

private String mutinySupportNeeded(CombinedIndexBuildItem indexBuildItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,6 @@ private static void registerProviders(ResteasyDeployment deployment,
ServletConfigSource.class,
ServletContextConfigSource.class,
FilterConfigSource.class));

// Providers that are also beans are unremovable
unremovableBeans.produce(new UnremovableBeanBuildItem(
b -> jaxrsProvidersToRegisterBuildItem.getProviders().contains(b.getBeanClass().toString())));
}

private static void generateDefaultConstructors(BuildProducer<BytecodeTransformerBuildItem> transformers,
Expand Down
25 changes: 4 additions & 21 deletions integration-tests/smallrye-opentracing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<!-- Server dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand All @@ -43,15 +43,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny</artifactId>
</dependency>

<!-- Client dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
<artifactId>quarkus-rest-client-mutiny</artifactId>
</dependency>

<!-- In-memory tracer -->
Expand Down Expand Up @@ -121,20 +117,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny-deployment</artifactId>
<artifactId>quarkus-resteasy-reactive-jackson-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
Expand All @@ -147,7 +130,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-deployment</artifactId>
<artifactId>quarkus-rest-client-mutiny-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ quarkus.datasource.jdbc.url=jdbc:tracing:postgresql://localhost:5432/mydatabase
quarkus.datasource.jdbc.driver=io.opentracing.contrib.jdbc.TracingDriver
quarkus.datasource.username=sa
quarkus.datasource.password=sa
quarkus.rest.single-default-produces=false

pingpong/mp-rest/url=${test.url}

0 comments on commit 4e9dea2

Please sign in to comment.