@@ -5,7 +5,7 @@ plugins {
55 id ' jacoco'
66 id ' maven-publish'
77 id " com.github.ben-manes.versions" version " 0.52.0"
8- id " org.cyclonedx.bom" version " 2.3.0 "
8+ id " org.cyclonedx.bom" version " 2.3.1 "
99}
1010
1111group = ' uk.gov.hmcts.dcs'
@@ -15,25 +15,17 @@ def githubToken = project.findProperty("github.token") ?: System.getenv("GITHUB_
1515def githubRepo = System . getenv(" GITHUB_REPOSITORY" )
1616
1717def formatterUrl = ' https://raw.githubusercontent.com/hmcts/api-cp-code-style/refs/heads/master/config/formatter/eclipse-formatter.xml'
18- def formatterPath = " $b uildDir /eclipse-formatter.xml"
18+ def formatterPath = " ${ layout.buildDirectory.get().asFile.absolutePath } /eclipse-formatter.xml"
1919
2020java {
2121 sourceCompatibility = JavaVersion . VERSION_17
2222 targetCompatibility = JavaVersion . VERSION_17
2323}
2424
25- repositories {
26- mavenLocal()
27- mavenCentral()
28- maven {
29- url = ' https://jitpack.io'
30- }
31- }
32-
3325openApiGenerate {
3426 generatorName = " java"
3527 inputSpec = " ${ rootDir} /src/main/resources/openapi/dcs-caseadmin.openapi.yml"
36- outputDir = " $b uildDir /generated/sources/openapi"
28+ outputDir = " ${ layout.buildDirectory.get().asFile.absolutePath } /generated/sources/openapi"
3729 modelPackage = " uk.gov.hmcts.dcs.openapi.model"
3830
3931 // Configuration options for the Java generator
@@ -55,7 +47,7 @@ openApiGenerate {
5547sourceSets {
5648 main {
5749 java {
58- srcDir " $b uildDir /generated/sources/openapi/src/main/java"
50+ srcDir " ${ layout.buildDirectory.get().asFile.absolutePath } /generated/sources/openapi/src/main/java"
5951 }
6052 }
6153}
@@ -127,6 +119,14 @@ tasks.named("dependencyUpdates").configure {
127119 }
128120}
129121
122+ repositories {
123+ mavenLocal()
124+ mavenCentral()
125+ maven {
126+ url = azureADOArtifactRepository
127+ }
128+ }
129+
130130publishing {
131131 publications {
132132 mavenJava(MavenPublication ) {
@@ -142,6 +142,14 @@ publishing {
142142 password = githubToken
143143 }
144144 }
145+ maven {
146+ name = " AzureArtifacts"
147+ url = uri(azureADOArtifactRepository)
148+ credentials {
149+ username = azureADOArtifactActor
150+ password = azureADOArtifactToken
151+ }
152+ }
145153 }
146154}
147155
@@ -153,7 +161,7 @@ cyclonedxBom {
153161 skipConfigs = [" test" , " testImplementation" ]
154162 schemaVersion = " 1.6"
155163 componentVersion = providers. provider { project. version. toString() }
156- destination = file(" $b uildDir /reports" )
164+ destination = file(" ${ layout.buildDirectory.get().asFile.absolutePath } /reports" )
157165 includeBuildSystem = true
158166 outputName = " bom"
159167 outputFormat = " json"
@@ -169,8 +177,7 @@ jar {
169177 } else {
170178 println " ⚠️ CHANGELOG.md not found, skipping inclusion in JAR"
171179 }
172-
173- def sbomFile = file(" $buildDir /reports/bom.json" )
180+ def sbomFile = file(" ${ layout.buildDirectory.get().asFile.absolutePath} /reports/bom.json" )
174181 if (sbomFile. exists()) {
175182 println " ✅ Including SBOM from ${ sbomFile} in JAR"
176183 from(sbomFile) {
@@ -216,7 +223,7 @@ tasks.register('downloadFormatter') {
216223}
217224
218225tasks. withType(Checkstyle ). configureEach {
219- def generatedDir = file(" ${ buildDir } /generated/sources/openapi/src/main/java" ). canonicalPath
226+ def generatedDir = file(" ${ layout.buildDirectory.get().asFile.absolutePath } /generated/sources/openapi/src/main/java" ). canonicalPath
220227 source = source. filter { file ->
221228 ! file. canonicalPath. startsWith(generatedDir)
222229 }
0 commit comments