Jira integration test fails in native mode
fixes
*/
package org.apache.camel.quarkus.component.jira.deployment;
+import java.util.ArrayList;
+import java.util.List;
+
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.camel.component.jira.JiraConfiguration;
+import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
+import org.joda.time.DateTimeZone;
class JiraProcessor {
@@ -40,4 +48,26 @@ class JiraProcessor {
return new RuntimeInitializedClassBuildItem("com.google.api.client.auth.oauth.OAuthParameters");
}
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection() {
+ return new ReflectiveClassBuildItem(true, true, JiraConfiguration.class);
+ }
+
+ @BuildStep()
+ UnbannedReflectiveBuildItem unbannedReflectiveItems() {
+ return new UnbannedReflectiveBuildItem(JiraConfiguration.class.getName());
+ }
+
+ @BuildStep
+ NativeImageResourceBuildItem nativeImageResources() {
+ // Add Joda timezone resources into the native image as it is required by com.atlassian.jira.rest.client.internal.json.JsonParseUtil
+ List<String> timezones = new ArrayList<>();
+ for (String timezone : DateTimeZone.getAvailableIDs()) {
+ String[] zoneParts = timezone.split("/");
+ if (zoneParts.length == 2) {
+ timezones.add(String.format("org/joda/time/tz/data/%s/%s", zoneParts[0], zoneParts[1]));
+ }
+ }
+ return new NativeImageResourceBuildItem(timezones);
+ }
}
