Skip to content

Commit

Permalink
Workaround for quarkiverse#1078 Wrong service file loaded in native m…
Browse files Browse the repository at this point in the history
…ode after upgrading Mandrel from 23.0.1.2 JDK 17.8 to 23.1.0.0 JDK 21.0
  • Loading branch information
ppalaga committed Oct 24, 2023
1 parent 219c817 commit a5d7025
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
import io.quarkus.deployment.builditem.GeneratedResourceBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.logging.LogCleanupFilterBuildItem;
import io.quarkus.deployment.pkg.PackageConfig;
import io.quarkus.deployment.pkg.PackageConfig.BuiltInType;
Expand Down Expand Up @@ -180,6 +180,13 @@ BuildTimeBusBuildItem bus() {
return new BuildTimeBusBuildItem(bus);
}

@BuildStep
void systemProperty(BuildProducer<SystemPropertyBuildItem> systemProperty) {
/* Workaround for https://github.com/quarkiverse/quarkus-cxf/issues/1078 */
systemProperty
.produce(new SystemPropertyBuildItem(BusFactory.BUS_FACTORY_PROPERTY_NAME, QuarkusBusFactory.class.getName()));
}

@BuildStep
void generateRuntimeBusServiceFile(BuildProducer<GeneratedResourceBuildItem> generatedResources) {
/*
Expand Down Expand Up @@ -511,16 +518,6 @@ void reflectiveClasses(

}

@BuildStep
void serviceProviders(BuildProducer<ServiceProviderBuildItem> serviceProvider) {

serviceProvider.produce(
new ServiceProviderBuildItem(
"org.apache.cxf.bus.factory",
"org.apache.cxf.bus.CXFBusFactory"));

}

void produceRecursiveProxies(IndexView index,
DotName interfaceDN,
BuildProducer<NativeImageProxyDefinitionBuildItem> proxies, Set<String> proxiesCreated) {
Expand Down Expand Up @@ -569,10 +566,11 @@ NativeImageResourceBundleBuildItem nativeImageResourceBundleBuildItem() {
@BuildStep
NativeImageResourceBuildItem nativeImageResourceBuildItem() {
// TODO add @HandlerChain (file) and parse it to add class loading
return new NativeImageResourceBuildItem("com/sun/xml/fastinfoset/resources/ResourceBundle.properties",
return new NativeImageResourceBuildItem(
"META-INF/services/" + BusFactory.BUS_FACTORY_PROPERTY_NAME,
"com/sun/xml/fastinfoset/resources/ResourceBundle.properties",
"META-INF/cxf/bus-extensions.txt",
"META-INF/cxf/cxf.xml",
"META-INF/cxf/org.apache.cxf.bus.factory",
"META-INF/blueprint.handlers",
"META-INF/spring.handlers",
"META-INF/spring.schemas",
Expand Down

0 comments on commit a5d7025

Please sign in to comment.