Skip to content

Commit 01e7bdb

Browse files
committed
Require 2.346.3
1 parent 9fecfd6 commit 01e7bdb

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

pom.xml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>3.53</version>
7+
<version>4.51</version>
8+
<relativePath></relativePath>
89
</parent>
910

1011
<artifactId>stash-pullrequest-builder</artifactId>
@@ -34,7 +35,7 @@
3435
</developers>
3536

3637
<scm>
37-
<connection>scm:git:ssh://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
38+
<connection>scm:git:https://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
3839
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/stash-pullrequest-builder-plugin.git</developerConnection>
3940
<tag>${scmTag}</tag>
4041
<url>https://github.com/jenkinsci/stash-pullrequest-builder-plugin</url>
@@ -56,19 +57,22 @@
5657
<properties>
5758
<revision>1.18</revision>
5859
<changelist>-SNAPSHOT</changelist>
59-
<java.level>8</java.level>
60-
<jenkins.version>2.60.3</jenkins.version>
60+
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
61+
<jenkins.baseline>2.346</jenkins.baseline>
62+
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
63+
<slf4jVersion>1.7.25</slf4jVersion>
6164
<spotbugs.effort>Max</spotbugs.effort>
6265
<spotbugs.threshold>Low</spotbugs.threshold>
6366
</properties>
6467

6568
<dependencyManagement>
6669
<dependencies>
6770
<dependency>
68-
<groupId>junit</groupId>
69-
<artifactId>junit</artifactId>
70-
<version>4.13</version>
71-
<scope>test</scope>
71+
<groupId>io.jenkins.tools.bom</groupId>
72+
<artifactId>bom-${jenkins.baseline}.x</artifactId>
73+
<version>1763.v092b_8980a_f5e</version>
74+
<type>pom</type>
75+
<scope>import</scope>
7276
</dependency>
7377
</dependencies>
7478
</dependencyManagement>
@@ -77,22 +81,18 @@
7781
<dependency>
7882
<groupId>org.jenkins-ci.plugins</groupId>
7983
<artifactId>jackson2-api</artifactId>
80-
<version>2.9.9.1</version>
8184
</dependency>
8285
<dependency>
8386
<groupId>org.jenkins-ci.plugins</groupId>
8487
<artifactId>credentials</artifactId>
85-
<version>2.1.5</version>
8688
</dependency>
8789
<dependency>
8890
<groupId>org.jenkins-ci.plugins</groupId>
8991
<artifactId>apache-httpcomponents-client-4-api</artifactId>
90-
<version>4.5.5-3.0</version>
9192
</dependency>
9293
<dependency>
9394
<groupId>org.slf4j</groupId>
9495
<artifactId>slf4j-api</artifactId>
95-
<version>${slf4jVersion}</version>
9696
<scope>provided</scope>
9797
</dependency>
9898
<dependency>
@@ -109,7 +109,6 @@
109109
<dependency>
110110
<groupId>org.jenkins-ci.plugins.workflow</groupId>
111111
<artifactId>workflow-job</artifactId>
112-
<version>2.9</version>
113112
<scope>test</scope>
114113
</dependency>
115114
</dependencies>

src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public class StashRepository {
5252
private static final String BUILD_START_MESSAGE = "BuildStarted";
5353
private static final String BUILD_FINISH_MESSAGE = "BuildFinished";
5454
private static final String BUILD_CANCEL_MESSAGE = "BuildCanceled";
55-
private static final String[] BUILD_STATUSES = {BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE};
55+
private static final String[] BUILD_STATUSES = {
56+
BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE
57+
};
5658
private static final String BUILD_MARKER = "[*%s* **%s**] %s into %s";
5759

5860
private static final String BUILD_STATUS_REGEX =
@@ -259,8 +261,10 @@ private List<StashPullRequestBuildTarget> getBuildTargetsWithoutOnlyBuildOnComme
259261

260262
// These will match any start or finish message -- need to check commits
261263
String escapedBuildName = Pattern.quote(job.getDisplayName());
262-
String project_build_start = String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
263-
String project_build_finished = String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
264+
String project_build_start =
265+
String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
266+
String project_build_finished =
267+
String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
264268
Matcher startMatcher =
265269
Pattern.compile(project_build_start, Pattern.CASE_INSENSITIVE).matcher(content);
266270
Matcher finishMatcher =
@@ -331,7 +335,8 @@ private String postBuildStatusComment(
331335
throws StashApiException {
332336
String sourceCommit = pullRequest.getFromRef().getLatestCommit();
333337
String destinationCommit = pullRequest.getToRef().getLatestCommit();
334-
String comment = format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
338+
String comment =
339+
format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
335340
StashPullRequestComment commentResponse;
336341
commentResponse =
337342
this.client.postPullRequestComment(pullRequest.getId(), comment, buildCommandCommentId);
@@ -579,17 +584,12 @@ public void postFinishedComment(
579584
String message = getMessageForBuildResult(buildResult);
580585
String comment =
581586
format(
582-
BUILD_MARKER,
583-
BUILD_FINISH_MESSAGE,
584-
job.getDisplayName(),
585-
sourceCommit,
586-
destinationCommit)
587-
+ format(
588-
BUILD_FINISH_SENTENCE,
589-
message,
590-
buildUrl,
591-
buildNumber,
592-
duration);
587+
BUILD_MARKER,
588+
BUILD_FINISH_MESSAGE,
589+
job.getDisplayName(),
590+
sourceCommit,
591+
destinationCommit)
592+
+ format(BUILD_FINISH_SENTENCE, message, buildUrl, buildNumber, duration);
593593

594594
comment = comment.concat(additionalComment);
595595

@@ -684,7 +684,8 @@ private void deletePreviousBuildFinishedComments(StashPullRequestResponseValue p
684684
continue;
685685
}
686686

687-
String project_build_finished = format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
687+
String project_build_finished =
688+
format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
688689
Matcher finishMatcher =
689690
Pattern.compile(project_build_finished, Pattern.CASE_INSENSITIVE).matcher(content);
690691

0 commit comments

Comments
 (0)