From f5f220f271f42bf69f34f61fedd9196f23d6a85b Mon Sep 17 00:00:00 2001 From: rsandell Date: Tue, 18 Oct 2022 16:53:58 +0200 Subject: [PATCH 1/2] Register XStream alias even earlier --- src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java b/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java index 6a73d7285..117d69325 100644 --- a/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java +++ b/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java @@ -7,6 +7,8 @@ import org.jenkinsci.plugins.github.migration.Migrator; import edu.umd.cs.findbugs.annotations.NonNull; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.DoNotUse; import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; @@ -23,6 +25,8 @@ public class GitHubPlugin extends Plugin { * Launched before plugin starts * Adds alias for {@link GitHubPlugin} to simplify resulting xml. */ + @Initializer(before = InitMilestone.SYSTEM_CONFIG_LOADED) + @Restricted(DoNotUse.class) public static void addXStreamAliases() { Migrator.enableCompatibilityAliases(); Migrator.enableAliases(); @@ -41,7 +45,6 @@ public static void runMigrator() throws Exception { @Override public void start() throws Exception { - addXStreamAliases(); } /** From 1a88c500457d79dd1238bba180ef1b4a24d3d5f1 Mon Sep 17 00:00:00 2001 From: rsandell Date: Tue, 18 Oct 2022 17:12:43 +0200 Subject: [PATCH 2/2] Clean up now empty start method --- src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java b/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java index 117d69325..4a45fbd2a 100644 --- a/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java +++ b/src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java @@ -43,10 +43,6 @@ public static void runMigrator() throws Exception { new Migrator().migrate(); } - @Override - public void start() throws Exception { - } - /** * Shortcut method for getting instance of {@link GitHubPluginConfig}. *