From 7a7de8c79a06e23d2cb04a2c8f5eb868bec39a8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Csvanga-hmcts=E2=80=9D?=
<“subash.vanga@hmcts.net”>
Date: Fri, 17 Jul 2026 12:26:11 +0100
Subject: [PATCH 1/4] EDO-965: enable Maven parallel reactor (-T 1C) for PR
verify build
The mvn 'verify sonar:sonar' command is defined in the shared
cpp-azure-devops-templates/pipelines/context-verify.yaml, which appends its
sonarQubeOptions parameter to the command. Pass '-T 1C' through that parameter
so the reactor builds/tests modules in parallel on the PR verify build,
scoped to this repo only (no change to the shared template).
---
azure-pipelines.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml
index 1275dd64e..c1d5980be 100644
--- a/azure-pipelines.yaml
+++ b/azure-pipelines.yaml
@@ -41,6 +41,9 @@ stages:
parameters:
sonarqube_project: ${{ variables['sonarqubeProject'] }}
sonarQubeType: 'sonarQubeAKS'
+ # EDO-965: run the Maven reactor in parallel (~2 threads on the 2-CPU agent) to speed up
+ # the PR verify build. Appended to the mvn command via the template's sonarQubeOptions passthrough.
+ sonarQubeOptions: '-T 1C'
- ${{ if eq(variables['Build.Reason'], 'IndividualCI') }}:
- template: pipelines/context-validation.yaml@cppAzureDevOpsTemplates
From d5b62145d10ab2fd75923c3c3039b40bca882bb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Csvanga-hmcts=E2=80=9D?=
<“subash.vanga@hmcts.net”>
Date: Fri, 17 Jul 2026 13:00:16 +0100
Subject: [PATCH 2/4] EDO-965: parallelise tests via surefire/failsafe
forkCount; drop -T 1C
-T 1C parallelised the whole reactor and broke the non-thread-safe compile/jar
steps in hearing-domain-common (maven-jar 'supplemental artifacts' error and a
maven-compiler NPE, differing per retry = a concurrency race). Remove the -T 1C
pipeline flag and instead set maven-surefire/maven-failsafe forkCount=2
(reuseForks) in the root pom. This keeps the reactor single-threaded (no build
races) and parallelises only the test phase (~75% of the build) across the two
CPUs on the PR-verify agent. Needs a validation run for test isolation/memory.
---
azure-pipelines.yaml | 3 ---
pom.xml | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml
index c1d5980be..1275dd64e 100644
--- a/azure-pipelines.yaml
+++ b/azure-pipelines.yaml
@@ -41,9 +41,6 @@ stages:
parameters:
sonarqube_project: ${{ variables['sonarqubeProject'] }}
sonarQubeType: 'sonarQubeAKS'
- # EDO-965: run the Maven reactor in parallel (~2 threads on the 2-CPU agent) to speed up
- # the PR verify build. Appended to the mvn command via the template's sonarQubeOptions passthrough.
- sonarQubeOptions: '-T 1C'
- ${{ if eq(variables['Build.Reason'], 'IndividualCI') }}:
- template: pipelines/context-validation.yaml@cppAzureDevOpsTemplates
diff --git a/pom.xml b/pom.xml
index 545b2bd61..b09e24091 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,6 +128,28 @@
sonar-maven-plugin
3.11.0.3922
+
+
+ maven-surefire-plugin
+
+ 2
+ true
+
+
+
+ maven-failsafe-plugin
+
+ 2
+ true
+
+
From 5257136c8fb4a05b4c204ff19be8fd0f0a99202d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Csvanga-hmcts=E2=80=9D?=
<“subash.vanga@hmcts.net”>
Date: Fri, 17 Jul 2026 17:02:53 +0100
Subject: [PATCH 3/4] EDO-965: opt in to Maven .m2 caching for PR verify build
Pass enableMavenCache=true to the context-verify template to measure the
build-time gain from caching Maven dependencies (hearing only).
---
azure-pipelines.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml
index 1275dd64e..71f093a80 100644
--- a/azure-pipelines.yaml
+++ b/azure-pipelines.yaml
@@ -41,6 +41,8 @@ stages:
parameters:
sonarqube_project: ${{ variables['sonarqubeProject'] }}
sonarQubeType: 'sonarQubeAKS'
+ # EDO-965: opt in to Maven .m2 caching to measure the build-time gain (hearing only).
+ enableMavenCache: true
- ${{ if eq(variables['Build.Reason'], 'IndividualCI') }}:
- template: pipelines/context-validation.yaml@cppAzureDevOpsTemplates
From 687ef089602852c946f71c98f564f5ee59756bf2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Csvanga-hmcts=E2=80=9D?=
<“subash.vanga@hmcts.net”>
Date: Fri, 17 Jul 2026 17:06:36 +0100
Subject: [PATCH 4/4] =?UTF-8?q?EDO-965:=20isolate=20cache=20experiment=20?=
=?UTF-8?q?=E2=80=94=20revert=20forkCount,=20point=20template=20ref=20at?=
=?UTF-8?q?=20branch?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Revert the surefire/failsafe forkCount=2 change (proved to over-subscribe the
2-CPU agent) so the build measures the Maven-cache gain in isolation. Temporarily
point the cppAzureDevOpsTemplates resource ref at the feature branch so the PR
build picks up the template's enableMavenCache change (revert ref to main after
the template change is merged).
---
azure-pipelines.yaml | 4 +++-
pom.xml | 22 ----------------------
2 files changed, 3 insertions(+), 23 deletions(-)
diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml
index 71f093a80..5f1f0dd19 100644
--- a/azure-pipelines.yaml
+++ b/azure-pipelines.yaml
@@ -21,7 +21,9 @@ resources:
type: github
name: hmcts/cpp-azure-devops-templates
endpoint: 'hmcts'
- ref: 'main'
+ # EDO-965 (TEMPORARY): point at the feature branch so the PR build uses the template's
+ # enableMavenCache change. REVERT to 'main' once the template change is merged.
+ ref: 'feature/sv-edo-965-improve-mvn-perf'
pool:
name: "MDV-ADO-AGENT-AKS-01"
diff --git a/pom.xml b/pom.xml
index b09e24091..545b2bd61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,28 +128,6 @@
sonar-maven-plugin
3.11.0.3922
-
-
- maven-surefire-plugin
-
- 2
- true
-
-
-
- maven-failsafe-plugin
-
- 2
- true
-
-