Skip to content

Commit ff57462

Browse files
authored
Migrate to Bitbucket Data Center 10.2.6 and Java 21 (4.0.0) (#34)
* Fixed version * Migrate to Central Publishing and add GitHub release workflow Replace legacy Sonatype OSSRH distributionManagement with central-publishing-maven-plugin and add release-to-central profile. Add GitHub Actions workflow to auto-create releases on tag push. Upgrade maven-gpg-plugin to 3.1.0. * Migrate to Bitbucket Data Center 10.2.6 and Java 21 - upgrade Bitbucket version 9.4.17 -> 10.2.6 and set application-version.min to 10.2.6 - upgrade to Java 21 (required by Bitbucket 10 / Atlassian Platform 8) - replace removed PageUtils.newRequest(...) with new PageRequestImpl(...) - remove bitbucket-page-objects dependency and add explicit JUnit 4.13.2 test dependency - replace removed TestApplicationUser test helper with a Mockito Person mock - bump maven-compiler-plugin to 3.13.0 and CI JDK to 21 * Bump version to 4.0.0-SNAPSHOT and CI to JDK 21 temurin - set pom version to 4.0.0-SNAPSHOT for the upcoming breaking major release - release.yml: build on JDK 21 (matches Java 21 compiler target) - maven.yml: use setup-java@v4 with temurin and checkout@v4, aligning with release.yml * Update README requirements and Jira dev command for Bitbucket 10 - bump requirements to Bitbucket Data Center 10.2.6+ / Java 21+ - update atlas-run-standalone example to Jira 10.3.23 * Bump AssertJ from 3.5.2 to 3.27.7 to address CVE-2026-24400 * Remove unused jackson.version property Jackson is provided by the Bitbucket platform BOM (jackson-databind resolves to 2.21.5 under Bitbucket 10.2.6), and the property was referenced nowhere. * Bump actions/setup-java from v4 to v5 in CI workflows setup-java v4 is deprecated; v5 is a drop-in (distribution and java-version are already specified).
1 parent 4fa8856 commit ff57462

9 files changed

Lines changed: 44 additions & 30 deletions

File tree

.github/workflows/maven.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up JDK 17
16-
uses: actions/setup-java@v1
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v5
1717
with:
18-
java-version: 17
18+
java-version: 21
19+
distribution: temurin
1920
- name: Cache local Maven repository
2021
uses: actions/cache@v4
2122
with:

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: Set up JDK 17
16-
uses: actions/setup-java@v4
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v5
1717
with:
18-
java-version: 17
18+
java-version: 21
1919
distribution: temurin
2020

2121
- name: Cache local Maven repository

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 4.0.0
2+
3+
- upgrade to Bitbucket Data Center 10.2.6 (from 9.4.17) and set minimum supported version to 10.2.6
4+
- upgrade to Java 21 (required by Bitbucket 10 / Atlassian Platform 8; Java 17 runtime support removed)
5+
- replace `PageUtils.newRequest(...)` with `new PageRequestImpl(...)` (`PageUtils` was removed from the public API in Bitbucket 10)
6+
- remove `bitbucket-page-objects` dependency (no longer used; previously provided JUnit transitively)
7+
- add explicit JUnit 4.13.2 test dependency (no longer available transitively after removing `bitbucket-page-objects`)
8+
- replace the removed `TestApplicationUser` test helper (dropped from `bitbucket-test-util` in Bitbucket 10) with a Mockito `Person` mock
9+
- bump AssertJ from 3.5.2 to 3.27.7 to address CVE-2026-24400
10+
- remove unused `jackson.version` property (Jackson is provided by the Bitbucket platform BOM)
11+
112
## 3.0.1
213

314
- Migrate from Sonatype OSSRH to Central Publishing Maven Plugin for Maven Central releases

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ For changes check the [changelog](CHANGELOG.md).
2626

2727
## <a name="Requirements"></a> Requirements:
2828

29-
1. Bitbucket Server 9.4.17+
30-
2. Java 17+
29+
1. Bitbucket Data Center 10.2.6+
30+
2. Java 21+
3131
3. Bitbucket Server has an application link with a Jira instance.
3232
4. User that commits the release commit exists on Jira and has rights to create the version and modify issues on the project.
3333

@@ -105,7 +105,7 @@ Pull requests are welcome!
105105

106106
- `atlas-clean` - similar to mvn clean, removes local instances of products (Bitbucket Server, Jira)
107107
- `atlas-debug` - runs the project product (Bitbucket Server) in debug mode, [guide for remote debugging](https://developer.atlassian.com/display/DOCS/Creating+a+Remote+Debug+Target)
108-
- `atlas-run-standalone --product jira -v 6.4` - runs local Jira instance of version 6.4
108+
- `atlas-run-standalone --product jira --version 10.3.23` - runs a local standalone Jira instance of version 10.3.23
109109

110110
## <a name="Credits"></a> Credits
111111

pom.xml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.infobip</groupId>
66
<artifactId>jira-version-generator</artifactId>
7-
<version>3.0.2-SNAPSHOT</version>
7+
<version>4.0.0-SNAPSHOT</version>
88
<packaging>atlassian-plugin</packaging>
99

1010
<name>Jira Version Generator</name>
@@ -63,25 +63,25 @@
6363

6464
<properties>
6565
<!-- DEPENDENCY VERSIONS -->
66-
<bitbucket.version>9.4.17</bitbucket.version>
66+
<bitbucket.version>10.2.6</bitbucket.version>
6767
<amps.version>9.9.1</amps.version>
6868
<slf4j.version>1.7.21</slf4j.version>
69-
<jackson.version>2.12.4</jackson.version>
70-
<assertj-core.version>3.5.2</assertj-core.version>
69+
<assertj-core.version>3.27.7</assertj-core.version>
7170
<mockito-core.version>5.23.0</mockito-core.version>
72-
<bitbucket.data.version>9.4.17</bitbucket.data.version>
71+
<junit.version>4.13.2</junit.version>
72+
<bitbucket.data.version>10.2.6</bitbucket.data.version>
7373

7474
<lombok.version>1.18.44</lombok.version>
7575

7676
<!-- PLUGIN VERSIONS -->
77-
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
77+
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
7878
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
7979
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
8080
<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
8181
<quickreload-plugin.version>6.2.1</quickreload-plugin.version>
8282

8383
<!-- OTHER PROPERTIES -->
84-
<java.version>17</java.version>
84+
<java.version>21</java.version>
8585
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8686
<maven.javadoc.skip>true</maven.javadoc.skip>
8787
</properties>
@@ -154,11 +154,6 @@
154154
<artifactId>applinks-api</artifactId>
155155
<scope>provided</scope>
156156
</dependency>
157-
<dependency>
158-
<groupId>com.atlassian.bitbucket.server</groupId>
159-
<artifactId>bitbucket-page-objects</artifactId>
160-
<scope>provided</scope>
161-
</dependency>
162157

163158
<dependency>
164159
<groupId>org.slf4j</groupId>
@@ -187,6 +182,13 @@
187182
<version>${mockito-core.version}</version>
188183
<scope>test</scope>
189184
</dependency>
185+
186+
<dependency>
187+
<groupId>junit</groupId>
188+
<artifactId>junit</artifactId>
189+
<version>${junit.version}</version>
190+
<scope>test</scope>
191+
</dependency>
190192
</dependencies>
191193

192194
<build>

src/main/java/com/infobip/bitbucket/CommitPageCrawler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.atlassian.bitbucket.repository.*;
2020
import com.atlassian.bitbucket.util.Page;
2121
import com.atlassian.bitbucket.util.PageRequest;
22-
import com.atlassian.bitbucket.util.PageUtils;
22+
import com.atlassian.bitbucket.util.PageRequestImpl;
2323

2424
import java.util.Iterator;
2525
import java.util.function.Function;
@@ -46,7 +46,7 @@ public static CommitPageCrawler of(CommitService commitService,
4646
return commitService.getCommitsBetween(request, pageRequest);
4747
};
4848

49-
Page<Commit> currentPage = pageProvider.apply(PageUtils.newRequest(0, PAGE_REQUEST_LIMIT));
49+
Page<Commit> currentPage = pageProvider.apply(new PageRequestImpl(0, PAGE_REQUEST_LIMIT));
5050

5151
return new CommitPageCrawler(pageProvider, currentPage);
5252
}

src/main/resources/atlassian-plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<description>${project.description}</description>
44
<version>${project.version}</version>
55
<vendor name="${project.organization.name}" url="${project.organization.url}" />
6-
<param name="application-version.min">9.4.17</param>
6+
<param name="application-version.min">10.2.6</param>
77
</plugin-info>
88

99
<component-import key="applicationLinkService" interface="com.atlassian.applinks.api.ApplicationLinkService" />

src/test/java/com/infobip/jira/JiraVersionGeneratorHookTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.atlassian.bitbucket.repository.RefChange;
2323
import com.atlassian.bitbucket.repository.Repository;
2424
import com.atlassian.bitbucket.setting.Settings;
25-
import com.atlassian.bitbucket.user.TestApplicationUser;
25+
import com.atlassian.bitbucket.user.Person;
2626
import com.atlassian.bitbucket.util.*;
2727
import com.atlassian.sal.api.net.ResponseException;
2828
import com.infobip.bitbucket.JiraVersionGeneratorHook;
@@ -305,15 +305,15 @@ private void thenGetCommits(VerificationMode verificationMode, RefChange refChan
305305

306306
Commit givenCommit(String message, LocalDate authorTimestamp) {
307307
return new SimpleCommit.Builder("id")
308-
.author(new TestApplicationUser(""))
308+
.author(org.mockito.Mockito.mock(Person.class))
309309
.message(message)
310310
.authorTimestamp(Date.from(authorTimestamp.atStartOfDay().toInstant(ZoneOffset.UTC)))
311311
.build();
312312
}
313313

314314
Commit givenCommit(String message) {
315315
return new SimpleCommit.Builder("id")
316-
.author(new TestApplicationUser(""))
316+
.author(org.mockito.Mockito.mock(Person.class))
317317
.message(message)
318318
.build();
319319
}

src/test/java/com/infobip/jira/JiraVersionGeneratorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import com.atlassian.applinks.api.CredentialsRequiredException;
1919
import com.atlassian.bitbucket.commit.Commit;
2020
import com.atlassian.bitbucket.commit.SimpleCommit;
21-
import com.atlassian.bitbucket.user.TestApplicationUser;
21+
import com.atlassian.bitbucket.user.Person;
2222
import com.atlassian.sal.api.net.ResponseException;
2323
import java.util.List;
2424
import org.junit.Before;
@@ -140,7 +140,7 @@ private void givenJiraVersionGeneratorWithReleaseCommit(Commit commit) {
140140

141141
private Commit givenCommit(String id, String message, LocalDate authorTimestamp) {
142142
return new SimpleCommit.Builder(id)
143-
.author(new TestApplicationUser(""))
143+
.author(org.mockito.Mockito.mock(Person.class))
144144
.message(message)
145145
.authorTimestamp(Date.from(authorTimestamp.atStartOfDay().toInstant(ZoneOffset.UTC)))
146146
.build();

0 commit comments

Comments
 (0)