quarkus 整个包的本机反射配置

2023-11-23

我正在构建 quarkus 本机并使用 Stripe sdk 作为外部库。 为了支持 Stripe sdk 我需要创建反射配置.json文件并在 application.properties 中设置quarkus.native.additional-build-args=-H:ReflectionConfigurationFiles=reflection-config.json

The 反射配置.json看起来像这样:

  {
    "name": "com.stripe.model.Customer",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  },
  {
    "name": "com.stripe.model.Customer$InvoiceSettings",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  },
  {
    "name": "com.stripe.model.StripeError",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  },
  {
    "name": "com.stripe.model.PaymentIntent",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  },
  {
    "name": "com.stripe.model.PaymentMethod",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  }....

等等。 它包含太多类。 我的问题是是否有办法设置整个包而不是大量的类? 例如:

  {
    "name": "com.stripe.model.*",
    "allDeclaredConstructors": true,
    "allPublicConstructors": true,
    "allDeclaredMethods": true,
    "allPublicMethods": true,
    "allDeclaredFields": true,
    "allPublicFields": true
  }

没有找到任何提及它。


请参阅下面的更新。

我有完全相同的用例以编程方式添加包的所有类以进行反射,而无需编写扩展。
我的目标是添加 jOOQ 生成的 DB 类进行反射,这样我就可以在带有 RESTEasy Reactive Jackson 的本机编译的 Quarkus GraalVM 映像中使用它们。
由于有很多这样的类,我真的不想手动填充reflection-config.json或目标@RegisterForReflection空类上的注释。

我正在使用夸库斯2.7.0.最终(不是io.quarkus.platform因为还没有发布)使用 Gradle 7.3.3 和尝试了以下方法,不幸的是不起作用。 但我想这只在构建扩展时才有效

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

quarkus 整个包的本机反射配置 的相关文章

随机推荐

Powered by Hwhale