lburgazzoli commented on a change in pull request #647: Fix #518 Rely on configurers for Configuration classes instead of using URL: https://github.com/apache/camel-quarkus/pull/647#discussion_r370193373
########## File path: extensions/support/policy/deployment/src/main/java/org/apache/camel/quarkus/component/support/policy/deployment/PolicyProcessor.java ########## @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.support.policy.deployment; + +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.GeneratedResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem; +import org.jboss.jandex.AnnotationTarget.Kind; +import org.jboss.jandex.DotName; + +class PolicyProcessor { + + private static final String FEATURE = "camel-policy"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep + UnbannedReflectiveBuildItem unbanReflectives() { + /** + * A list of classes annotated with <code>@UriParams</code> which we accept to be registered for reflection + * mostly because there are errors when they are removed. TODO: solve the underlying problems and remove as + * many entries as possible from the list. + */ + return new UnbannedReflectiveBuildItem( + "org.apache.camel.support.processor.DefaultExchangeFormatter", + "org.apache.camel.component.pdf.PdfConfiguration", + "org.apache.camel.component.netty.NettyConfiguration", + "org.apache.camel.component.netty.NettyServerBootstrapConfiguration", + "org.apache.camel.component.fhir.FhirUpdateEndpointConfiguration", + "org.apache.camel.component.fhir.FhirOperationEndpointConfiguration", + "org.apache.camel.component.fhir.FhirConfiguration", + "org.apache.camel.component.fhir.FhirLoadPageEndpointConfiguration", + "org.apache.camel.component.fhir.FhirSearchEndpointConfiguration", + "org.apache.camel.component.fhir.FhirTransactionEndpointConfiguration", + "org.apache.camel.component.fhir.FhirCreateEndpointConfiguration", + "org.apache.camel.component.fhir.FhirValidateEndpointConfiguration", + "org.apache.camel.component.fhir.FhirReadEndpointConfiguration", + "org.apache.camel.component.fhir.FhirCapabilitiesEndpointConfiguration", + "org.apache.camel.component.fhir.FhirHistoryEndpointConfiguration", + "org.apache.camel.component.fhir.FhirMetaEndpointConfiguration", + "org.apache.camel.component.fhir.FhirPatchEndpointConfiguration", + "org.apache.camel.component.fhir.FhirDeleteEndpointConfiguration", + + /* org.apache.camel.component.consul.* can be removed after the upgrade to Camel 3.1 */ + "org.apache.camel.component.consul.ConsulConfiguration", + "org.apache.camel.component.consul.ConsulClientConfiguration", + "org.apache.camel.component.consul.health.ConsulHealthCheckRepositoryConfiguration", + "org.apache.camel.component.consul.cloud.ConsulServiceRegistryConfiguration"); Review comment: It does not change much from the previous implementation as when we'll remove i.e. `PdfConfiguration` from the pdf extension we have to remember to get to this artefact and change it. I really don't get why this should not be side-by-side with the code declaring the need for the reflective classes. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services