Quarkus 本机和 org.kohsuke:github-api - 解析期间未解析的方法 - @WithBridgeMethods 注释方法

Quarkus native and org.kohsuke:github-api - unresolved method during parsing - @WithBridgeMethods annotated method

Quarkus 本机和 org.kohsuke:github-api - 解析期间未解析的方法 - @WithBridgeMethods 注释方法

这是 question, I'm using https://github.com/quarkusio/quarkus/pull/9182 补丁的后续版本,用于克服 GHRepository.GHRepoPermission.class 的注册反射挑战,后者是私有内部 class。

我必须将 GHLicense.class 添加到 @RegisterForReflection,现在我的示例应用程序在本机编译期间失败,提示:发现未解决的方法

[getting-started-1.0-SNAPSHOT-runner:42440]     analysis:  60,222.05 ms,  6.04 GB
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.kohsuke.github.GHLicense.urlToString(java.net.URL, java.lang.Class). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
    at parsing org.kohsuke.github.GHLicense.getUrl(GHLicense.java)
Call path from entry point to org.kohsuke.github.GHLicense.getUrl():
    at org.kohsuke.github.GHLicense.getUrl(GHLicense.java)
    at com.oracle.svm.reflect.GHObject_getUrl_d595a42af79d3a07fda24477277adddcaeacd46d_608.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:122)

https://github.com/hub4j/github-api/blob/master/src/main/java/org/kohsuke/github/GHLicense.java#L84 getUrl() 方法使用 @WithBridgeMethods 注释

    @WithBridgeMethods(value = String.class, adapterMethod = "urlToString")
    public URL getUrl() {
        return GitHubClient.parseURL(url);
    }

有任何解决方法的提示吗?或者这纯粹是 GraalVM 的事情?

这纯粹是一个 GraalVM 问题,解决它的唯一方法(我知道除了更改实际库中的代码之外)是创建一个 Quarkus 扩展来替换库中有问题的部分。

更新

This Quarkus extension essentially makes the library work properly in native mode and is the basis of the Quarkus Bot 在 Quarkus GitHub 存储库上用于各种任务的应用程序。