@@ -146,6 +146,10 @@ tasks.named('jacocoTestReport') {
146146 }
147147}
148148
149+ tasks. named(' check' ) {
150+ dependsOn tasks. named(' integration' )
151+ }
152+
149153pmd {
150154 ruleSets = []
151155 ruleSetFiles = files(" .github/pmd-ruleset.xml" )
@@ -158,10 +162,12 @@ tasks.withType(Pmd) {
158162 html. required. set(true )
159163 }
160164}
161-
162- tasks. named(' check' ) {
163- dependsOn tasks. named(' integration' )
165+ tasks. named(" pmdMain" ). configure {
166+ onlyIf { gradle. startParameter. taskNames. contains(name) }
164167}
168+ tasks. named(" pmdTest" ). configure { enabled = false }
169+ tasks. named(" pmdIntegrationTest" ). configure { enabled = false }
170+ tasks. named(" pmdPactVerificationTest" ). configure { enabled = false }
165171
166172// check dependencies upon release ONLY
167173tasks. named(" dependencyUpdates" ). configure {
@@ -258,7 +264,7 @@ tasks.named('processPactVerificationTestResources') {
258264
259265dependencies {
260266 implementation " uk.gov.hmcts.cp:api-cp-crime-schedulingandlisting-courtschedule:$apiCourtScheduleVersion "
261- implementation ' org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.12 '
267+ implementation ' org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13 '
262268 implementation ' io.swagger.core.v3:swagger-core:2.2.36'
263269 implementation ' javax.xml.bind:jaxb-api:2.3.1'
264270
@@ -301,4 +307,14 @@ dependencies {
301307
302308 testImplementation ' au.com.dius.pact.provider:junit5:4.6.17'
303309 testImplementation ' au.com.dius.pact.provider:spring6:4.6.17'
310+
311+ // integrationTestImplementation dependencies are need as they aren't always propagate as expected,
312+ // especially with platform BOMs, test runtime dependencies, or custom tasks. Explicit dependencies eliminate that risk.
313+ integrationTestImplementation platform(' org.junit:junit-bom:5.13.4' )
314+ integrationTestRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine'
315+ integrationTestImplementation group : ' org.springframework.boot' , name : ' spring-boot-starter-test' , version : ' 3.5.5' , {
316+ exclude group : ' junit' , module : ' junit'
317+ exclude group : ' org.junit.vintage' , module : ' junit-vintage-engine'
318+ }
319+ integrationTestRuntimeOnly ' org.junit.platform:junit-platform-launcher'
304320}
0 commit comments