Skip to content

Commit

Permalink
[JENKINS-74848] Issue in config.xml CannotResolveClassException: com.…
Browse files Browse the repository at this point in the history
…cloudbees.jenkins.plugins.bitbucket.MergeWithGitSCMExtension (#911)

Add an alias to fix XStream serialisation
  • Loading branch information
nfalco79 authored Nov 18, 2024
1 parent 0bf5661 commit 3bf7402
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@
import hudson.RestrictedSince;
import hudson.Util;
import hudson.console.HyperlinkNote;
import hudson.init.InitMilestone;
import hudson.init.Initializer;
import hudson.model.Action;
import hudson.model.Actionable;
import hudson.model.Item;
import hudson.model.Items;
import hudson.model.TaskListener;
import hudson.plugins.git.GitSCM;
import hudson.scm.SCM;
Expand All @@ -87,6 +90,7 @@
import java.util.logging.Logger;
import jenkins.authentication.tokens.api.AuthenticationTokens;
import jenkins.model.Jenkins;
import jenkins.plugins.git.MergeWithGitSCMExtension;
import jenkins.plugins.git.traits.GitBrowserSCMSourceTrait;
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMHeadCategory;
Expand Down Expand Up @@ -140,6 +144,14 @@ public class BitbucketSCMSource extends SCMSource {
private static final String CLOUD_REPO_TEMPLATE = "{/owner,repo}";
private static final String SERVER_REPO_TEMPLATE = "/projects{/owner}/repos{/repo}";

/**
* Mapping classes after refactoring for backward compatibility.
*/
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void aliases() {
Items.XSTREAM2.addCompatibilityAlias("com.cloudbees.jenkins.plugins.bitbucket.MergeWithGitSCMExtension", MergeWithGitSCMExtension.class);
}

/** How long to delay events received from Bitbucket in order to allow the API caches to sync. */
private static /*mostly final*/ int eventDelaySeconds =
Math.min(
Expand Down

0 comments on commit 3bf7402

Please sign in to comment.