File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -217,14 +217,22 @@ class SbomPlugin implements Plugin<Project> {
217217 // components[*].licenses
218218 def comps = (bom instanceof Map && bom. components instanceof List ) ? bom. components : []
219219 comps. each { c ->
220- if (c instanceof Map && c. licenses instanceof List && ! (c. licenses as List ). isEmpty() ) {
220+ if (c instanceof Map && c. licenses instanceof List && ! (c. licenses as List ). empty ) {
221221 def chosen = pickLicense(task, c[' bom-ref' ] as String , c. licenses as List )
222222 if (chosen != null ) {
223223 c. licenses = [chosen]
224224 }
225225 }
226226 }
227227
228+ // dependencies[*].dependsOn is not reproducible, so sort it
229+ def dependencies = (bom instanceof Map && bom. dependencies instanceof List ) ? bom. dependencies : []
230+ dependencies. each { d ->
231+ if (d instanceof Map && d. dependsOn instanceof List && ! (d. dependsOn as List ). empty) {
232+ d. dependsOn = (d. dependsOn as List ). sort()
233+ }
234+ }
235+
228236 // force the serialNumber to be reproducible by removing it & recalculating
229237 bom[' serialNumber' ] = ' '
230238 def withOutSerial = JsonOutput . prettyPrint(JsonOutput . toJson(bom))
You can’t perform that action at this time.
0 commit comments