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

Remove camel-rest workaround as the fic for the issue is included in Apache Camel 3.3.0 #1265

Merged
merged 1 commit into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,8 @@
*/
package org.apache.camel.quarkus.component.rest.deployment;

import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import org.apache.camel.component.rest.RestComponent;
import org.apache.camel.quarkus.component.rest.RestRecorder;
import org.apache.camel.quarkus.component.rest.graal.NoJAXBContext;
import org.apache.camel.quarkus.core.deployment.spi.CamelBeanBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilter;
import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilterBuildItem;
import org.apache.camel.quarkus.support.common.CamelCapabilities;

class RestProcessor {
private static final String FEATURE = "camel-rest";
Expand All @@ -37,65 +26,4 @@ class RestProcessor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

//
// RestAssured brings XML bind APIs to the classpath:
//
// [INFO] +- io.rest-assured:rest-assured:jar:4.3.0:test
// [INFO] | +- org.codehaus.groovy:groovy:jar:3.0.2:test
// [INFO] | +- org.codehaus.groovy:groovy-xml:jar:3.0.2:test
// [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.11:test
// [INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.13:test
// [INFO] | | \- commons-codec:commons-codec:jar:1.13:test
// [INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.3:test
// [INFO] | +- org.hamcrest:hamcrest:jar:2.1:test
// [INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
// [INFO] | +- io.rest-assured:json-path:jar:4.3.0:test
// [INFO] | | +- org.codehaus.groovy:groovy-json:jar:3.0.2:test
// [INFO] | | \- io.rest-assured:rest-assured-common:jar:4.3.0:test
// >> [INFO] | \- io.rest-assured:xml-path:jar:4.3.0:test
// [INFO] | +- org.apache.commons:commons-lang3:jar:3.9:test
// >> [INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:test
// [INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:test
// [INFO] | \- org.apache.sling:org.apache.sling.javax.activation:jar:0.1.0:test
//
// For tests in JVM mode the condition NoJAXBContext is always false as a consequence of
// RestAssured transitive dependencies so we need an additional check on the presence of
// the org.apache.camel.xml.jaxb feature to make the behaviour consistent ion both modes.
//
// Excluding io.rest-assured:xml-path from the transitive dependencies does not seem to work
// as it lead to the RestAssured framework to fail to instantiate.
//

@BuildStep(onlyIf = NoJAXBContext.class)
void serviceFilter(
Capabilities capabilities,
BuildProducer<CamelServiceFilterBuildItem> serviceFilter) {

// if jaxb is configured, don't replace the method
if (capabilities.isCapabilityPresent(CamelCapabilities.XML_JAXB)) {
return;
}

serviceFilter.produce(new CamelServiceFilterBuildItem(CamelServiceFilter.forComponent("rest")));
}

@Record(ExecutionTime.STATIC_INIT)
@BuildStep(onlyIf = NoJAXBContext.class)
void restComponent(
RestRecorder recorder,
Capabilities capabilities,
BuildProducer<CamelBeanBuildItem> camelBeans) {

// if jaxb is configured, don't replace the method
if (capabilities.isCapabilityPresent(CamelCapabilities.XML_JAXB)) {
return;
}

camelBeans.produce(
new CamelBeanBuildItem(
"rest",
RestComponent.class.getName(),
recorder.createRestComponent()));
}
}

This file was deleted.