Thomas Kriechbaum
Thomas Kriechbaum

Reputation: 23

Quarkus Extension - Remove a class from dependent library or replace part of a class

Within a custom Quarkus extension I would like to integrate an existing java library that currently is not compatible to Quarkus.

Are there any examples for the following use cases:

Thanks, Thomas

Upvotes: 2

Views: 1045

Answers (1)

geoand
geoand

Reputation: 64039

For the first case, you can use a io.quarkus.deployment.builditem.RemovedResourceBuildItem to have Quarkus essentially remove a class from a dependency.

For the second case, you'll likely need to use a io.quarkus.deployment.builditem.BytecodeTransformerBuildItem which lets you declare an ASM class transformer which can change a class in arbitrary ways.

If you are only looking to change the class for native mode, it's much easier to instead use com.oracle.svm.core.annotate.TargetClass and com.oracle.svm.core.annotate.Substitute.

Upvotes: 1

Related Questions