-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force the use of the Java 11 HTTP client
The version of OkHttp used in the Quarkus BOM is very old and is not compatible with the GitHub API anymore. Now that there is a properly working Java 11 HTTP client implementation, we can simply drop it and favor the Java 11 client.
- Loading branch information
Showing
3 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...me/src/main/java/io/quarkiverse/githubapp/runtime/graal/Delete_OkHttpGitHubConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkiverse.githubapp.runtime.graal; | ||
|
||
import com.oracle.svm.core.annotate.Delete; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
/** | ||
* We drop this connector altogether as the OkHttp version we are using is not compatible with so we can't build the native | ||
* executable with it around. | ||
* <p> | ||
* One option to fix it is to force using a newer version in each GitHub App project but it's not very practical, especially | ||
* since we are now using OkHttp just for the event source in dev mode. | ||
*/ | ||
@TargetClass(className = "org.kohsuke.github.extras.okhttp3.OkHttpGitHubConnector") | ||
@Delete | ||
public final class Delete_OkHttpGitHubConnector { | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...c/main/java/io/quarkiverse/githubapp/runtime/graal/Substitute_DefaultGitHubConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkiverse.githubapp.runtime.graal; | ||
|
||
import org.kohsuke.github.connector.GitHubConnector; | ||
import org.kohsuke.github.extras.HttpClientGitHubConnector; | ||
import org.kohsuke.github.internal.DefaultGitHubConnector; | ||
|
||
import com.oracle.svm.core.annotate.Substitute; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
/** | ||
* Force the Java 11 HTTP client usage. | ||
*/ | ||
@TargetClass(DefaultGitHubConnector.class) | ||
public final class Substitute_DefaultGitHubConnector { | ||
|
||
@Substitute | ||
static GitHubConnector create(String defaultConnectorProperty) { | ||
return new HttpClientGitHubConnector(); | ||
} | ||
} |