Skip to content

Commit 7a944dd

Browse files
committed
chore: update sbom references so they are reproducible
1 parent 085f298 commit 7a944dd

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,32 @@ class SbomPlugin implements Plugin<Project> {
164164
)
165165
]
166166
))
167-
task.@externalReferences.set([
168-
new ExternalReference(
169-
url: 'https://grails.apache.org',
170-
type: ExternalReference.Type.WEBSITE
171-
),
172-
new ExternalReference(
173-
url: 'https://github.com/apache/grails-core',
174-
type: ExternalReference.Type.VCS
167+
168+
def projectVersion = project.findProperty('projectVersion').toString()
169+
def references = [
170+
new ExternalReference(
171+
url: 'https://grails.apache.org',
172+
type: ExternalReference.Type.WEBSITE
173+
),
174+
new ExternalReference(
175+
url: 'https://github.com/apache/grails-core',
176+
type: ExternalReference.Type.VCS
177+
),
178+
new ExternalReference(
179+
url: projectVersion.endsWith('SNAPSHOT') ? '[email protected]' : '[email protected]',
180+
type: ExternalReference.Type.MAILING_LIST
181+
)
182+
]
183+
184+
if(!projectVersion.endsWith('SNAPSHOT')) {
185+
references.add(
186+
new ExternalReference(
187+
url: "https://grails.apache.org/docs/${project.findProperty('projectVersion')}/index.html",
188+
type: ExternalReference.Type.DOCUMENTATION
189+
)
175190
)
176-
])
191+
}
192+
task.@externalReferences.set(references)
177193

178194
// sboms are published for the purposes of vulnerability analysis so only include the runtime classpath
179195
includeConfigs = ['runtimeClasspath']

0 commit comments

Comments
 (0)