Skip to content

Commit a8fe26c

Browse files
fglockDevin
andcommitted
Add SBOM storage locations section to design document
Documents where SBOM files will be stored in: - Build output (build/reports/sbom/ for Gradle, target/ for Maven) - JAR distribution (META-INF/sbom/) - DEB package (/opt/perlonjava/share/sbom/) - GitHub release artifacts (standalone files) Includes configuration snippets for embedding SBOM in JAR and DEB. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
1 parent d0a09df commit a8fe26c

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

dev/design/sbom.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,127 @@ Alternatively, keep them separate:
276276

277277
---
278278

279+
## SBOM Storage Locations
280+
281+
### Build Output (Development)
282+
283+
During build, SBOMs are generated to:
284+
285+
| Build System | Location | Files |
286+
|--------------|----------|-------|
287+
| Gradle | `build/reports/sbom/` | `bom.json`, `bom.xml` |
288+
| Maven | `target/` | `bom.json`, `bom.xml` |
289+
290+
### Distribution: JAR File
291+
292+
SBOMs should be embedded inside the JAR following CycloneDX conventions:
293+
294+
```
295+
perlonjava-5.42.0.jar
296+
├── META-INF/
297+
│ ├── MANIFEST.MF
298+
│ └── sbom/
299+
│ ├── bom.json # CycloneDX JSON format
300+
│ └── bom.xml # CycloneDX XML format (optional)
301+
└── ... (other contents)
302+
```
303+
304+
To include SBOM in JAR, add to `build.gradle`:
305+
```groovy
306+
// Copy SBOM into JAR's META-INF/sbom/
307+
shadowJar {
308+
from("$buildDir/reports/sbom") {
309+
into 'META-INF/sbom'
310+
include '*.json', '*.xml'
311+
}
312+
}
313+
314+
// Ensure SBOM is generated before JAR
315+
shadowJar.dependsOn cyclonedxBom
316+
```
317+
318+
For Maven, add to `pom.xml`:
319+
```xml
320+
<plugin>
321+
<groupId>org.apache.maven.plugins</groupId>
322+
<artifactId>maven-resources-plugin</artifactId>
323+
<executions>
324+
<execution>
325+
<id>copy-sbom</id>
326+
<phase>package</phase>
327+
<goals><goal>copy-resources</goal></goals>
328+
<configuration>
329+
<outputDirectory>${project.build.outputDirectory}/META-INF/sbom</outputDirectory>
330+
<resources>
331+
<resource>
332+
<directory>${project.build.directory}</directory>
333+
<includes>
334+
<include>bom.json</include>
335+
<include>bom.xml</include>
336+
</includes>
337+
</resource>
338+
</resources>
339+
</configuration>
340+
</execution>
341+
</executions>
342+
</plugin>
343+
```
344+
345+
### Distribution: DEB Package
346+
347+
For Debian packages, SBOMs go in the standard documentation directory:
348+
349+
```
350+
/opt/perlonjava/
351+
├── bin/
352+
│ └── jperl
353+
├── lib/
354+
│ └── perlonjava-5.42.0.jar
355+
└── share/
356+
└── sbom/
357+
├── bom.json
358+
└── bom.xml
359+
```
360+
361+
Alternative location (Debian convention):
362+
```
363+
/usr/share/doc/perlonjava/
364+
├── copyright
365+
├── changelog.gz
366+
└── sbom/
367+
├── bom.json
368+
└── bom.xml
369+
```
370+
371+
To include in DEB package, update `build.gradle`:
372+
```groovy
373+
ospackage {
374+
// ... existing config ...
375+
376+
// Include SBOM in package
377+
from("$buildDir/reports/sbom") {
378+
into '/opt/perlonjava/share/sbom'
379+
include '*.json', '*.xml'
380+
}
381+
}
382+
```
383+
384+
### GitHub Release Artifacts
385+
386+
SBOMs should also be attached as separate release artifacts:
387+
388+
```
389+
Release v5.42.0
390+
├── perlonjava-5.42.0.jar
391+
├── perlonjava_5.42.0_amd64.deb
392+
├── perlonjava-5.42.0-sbom.json # Standalone SBOM
393+
└── perlonjava-5.42.0-sbom.xml # Standalone SBOM (XML)
394+
```
395+
396+
This allows consumers to inspect the SBOM without downloading/extracting the full package.
397+
398+
---
399+
279400
## CI/CD Integration
280401

281402
### GitHub Actions

0 commit comments

Comments
 (0)