Java Code Examples for hudson.init.InitMilestone#PLUGINS_STARTED

The following examples show how to use hudson.init.InitMilestone#PLUGINS_STARTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GitLabConnection.java    From gitlab-plugin with GNU General Public License v2.0 6 votes vote down vote up
@Initializer(after = InitMilestone.PLUGINS_STARTED)
public static void migrate() throws IOException {
    GitLabConnectionConfig descriptor = (GitLabConnectionConfig) Jenkins.get().getDescriptor(GitLabConnectionConfig.class);
    if (descriptor == null) return;
    for (GitLabConnection connection : descriptor.getConnections()) {
        if (connection.apiTokenId == null && connection.apiToken != null) {
            for (CredentialsStore credentialsStore : CredentialsProvider.lookupStores(Jenkins.getInstance())) {
                if (credentialsStore instanceof SystemCredentialsProvider.StoreImpl) {
                    List<Domain> domains = credentialsStore.getDomains();
                    connection.apiTokenId = UUID.randomUUID().toString();
                    credentialsStore.addCredentials(domains.get(0),
                        new GitLabApiTokenImpl(CredentialsScope.SYSTEM, connection.apiTokenId, "GitLab API Token", Secret.fromString(connection.apiToken)));
                }
            }
        }
    }
    descriptor.save();
}
 
Example 2
Source File: KubernetesCloud.java    From kubernetes-plugin with Apache License 2.0 5 votes vote down vote up
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void addAliases() {
    Jenkins.XSTREAM2.addCompatibilityAlias(
            "org.csanchez.jenkins.plugins.kubernetes.OpenShiftBearerTokenCredentialImpl",
            org.jenkinsci.plugins.kubernetes.credentials.OpenShiftBearerTokenCredentialImpl.class);
    Jenkins.XSTREAM2.addCompatibilityAlias(
            "org.csanchez.jenkins.plugins.kubernetes.OpenShiftTokenCredentialImpl",
            StringCredentialsImpl.class);
    Jenkins.XSTREAM2.addCompatibilityAlias("org.csanchez.jenkins.plugins.kubernetes.ServiceAccountCredential",
            org.jenkinsci.plugins.kubernetes.credentials.FileSystemServiceAccountCredential.class);
}
 
Example 3
Source File: IssuesRecorder.java    From warnings-ng-plugin with MIT License 4 votes vote down vote up
/** Retain backward compatibility. */
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void addAliases() {
    Run.XSTREAM2.addCompatibilityAlias("io.jenkins.plugins.analysis.core.views.ResultAction",
            ResultAction.class);
}
 
Example 4
Source File: BuildStatusConfig.java    From github-autostatus-plugin with MIT License 4 votes vote down vote up
/**
 * Adds compatibility aliases to prevent "old data" warnings.
 */
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void addCompatibilityAliases() {
    XSTREAM2.addCompatibilityAlias("org.jenkinsci.plugins.githubautostatus.BuildStageModel", BuildStage.class);
    XSTREAM2.addCompatibilityAlias("org.jenkinsci.plugins.githubautostatus.notifiers.BuildState", BuildState.class);
}
 
Example 5
Source File: GitHubSCMSource.java    From github-branch-source-plugin with MIT License 4 votes vote down vote up
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void addAliases() {
    XSTREAM2.addCompatibilityAlias("org.jenkinsci.plugins.github_branch_source.OriginGitHubSCMSource", GitHubSCMSource.class);
}
 
Example 6
Source File: MatrixMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
/**
 * Gives this class an alias for configuration XML.
 */
@Initializer(before = InitMilestone.PLUGINS_STARTED)
@SuppressWarnings(UNUSED)
public static void registerXStream() {
    Items.XSTREAM.alias("matrix-multi-branch-project", MatrixMultiBranchProject.class);
}
 
Example 7
Source File: BranchListView.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
/**
 * Gives this class an alias for configuration XML.
 */
@SuppressWarnings(UNUSED)
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void registerXStream() {
    Items.XSTREAM.alias("branch-list-view", BranchListView.class);
}
 
Example 8
Source File: IvyMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
/**
 * Gives this class an alias for configuration XML.
 */
@SuppressWarnings(UNUSED)
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void registerXStream() {
    Items.XSTREAM.alias("ivy-multi-branch-project", IvyMultiBranchProject.class);
}
 
Example 9
Source File: FreeStyleMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
/**
 * Gives this class an alias for configuration XML.
 */
@Initializer(before = InitMilestone.PLUGINS_STARTED)
@SuppressWarnings("unused")
public static void registerXStream() {
    Items.XSTREAM.alias("freestyle-multi-branch-project", FreeStyleMultiBranchProject.class);
}
 
Example 10
Source File: MavenMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
/**
 * Gives this class an alias for configuration XML.
 */
@Initializer(before = InitMilestone.PLUGINS_STARTED)
@SuppressWarnings(UNUSED)
public static void registerXStream() {
    Items.XSTREAM.alias("maven-multi-branch-project", MavenMultiBranchProject.class);
}
 
Example 11
Source File: ResteasyGitLabClientBuilder.java    From gitlab-plugin with GNU General Public License v2.0 4 votes vote down vote up
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void setRuntimeDelegate() {
    RuntimeDelegate.setInstance(new ResteasyProviderFactory());
}
 
Example 12
Source File: PluginImpl.java    From zulip-plugin with MIT License 4 votes vote down vote up
@Initializer(before = InitMilestone.PLUGINS_STARTED)
public static void addAliases() {
  Items.XSTREAM2.addCompatibilityAlias("hudson.plugins.humbug.HumbugNotifier", ZulipNotifier.class);
}