Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-70684] Deprecate standalone use of hudson.Main #9023

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions core/src/main/java/hudson/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
*/
public class Main {

/** @see #remotePost */
/**
* @see #remotePost
* @deprecated Scheduled for removal in mid 2024.
* */
@Deprecated
public static void main(String[] args) {
try {
System.exit(run(args));
Expand All @@ -67,8 +71,16 @@
}
}

/** @see #remotePost */
/**
* @see #remotePost
* @deprecated Scheduled for removal in mid 2024.
* */
@Deprecated
public static int run(String[] args) throws Exception {
System.err.println("Running `java -jar jenkins-core.jar …` has been deprecated and will be removed in a future release.");
System.err.println("Use `java -jar jenkins-cli.jar set-external-build-result …` instead.");
System.err.println("See JENKINS-70684 for more information.");

Check warning on line 82 in core/src/main/java/hudson/Main.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 80-82 are not covered by tests

String home = getHudsonHome();
if (home == null) {
System.err.println("JENKINS_HOME is not set.");
Expand All @@ -91,7 +103,9 @@
/**
* Run command and send result to {@code ExternalJob} in the {@code external-monitor-job} plugin.
* Obsoleted by {@code SetExternalBuildResultCommand} but kept here for compatibility.
* @deprecated Scheduled for removal in mid 2024.
*/
@Deprecated
public static int remotePost(String[] args) throws Exception {
String projectName = args[0];

Expand Down Expand Up @@ -233,6 +247,8 @@

/**
* Time out for socket connection to Hudson.
* @deprecated Scheduled for removal in mid 2024.
*/
@Deprecated
public static final int TIMEOUT = SystemProperties.getInteger(Main.class.getName() + ".timeout", 15000);
}