aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
index 3e8e84b..ea8e892 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuilds.java
@@ -5,6 +5,7 @@ import hudson.model.AbstractBuild;
import hudson.model.Cause;
import hudson.model.Result;
import jenkins.model.Jenkins;
+import jenkins.model.JenkinsLocationConfiguration;
import java.io.IOException;
import java.util.logging.Level;
@@ -49,7 +50,8 @@ public class BitbucketBuilds {
return;
}
Result result = build.getResult();
- String rootUrl = Jenkins.getInstance().getRootUrl();
+ JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
+ String rootUrl = globalConfig.getUrl();
String buildUrl = "";
if (rootUrl == null) {
logger.warning("PLEASE SET JENKINS ROOT URL IN GLOBAL CONFIGURATION FOR BUILD STATE REPORTING");