Skip to content

Commit 404b98f

Browse files
authored
Merge pull request #45 from LogFlames/document_sbom_to_maven_central
📝 docs: Document SBOM to maven central
2 parents 066d06e + c85b427 commit 404b98f

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

sbom-github.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Adding SBOMs to your GitHub Releases with Jreleaser
1+
# Adding SBOMs to your GitHub and Maven Central Releases with Jreleaser
22

33
## Motivation
44
Software Bill of Materials (SBOMs) are critical to modern software development and supply chain management.
55
An SBOM is a complete inventory of all the components and dependencies of a software product.
66
It provides a detailed list of all the open-source and third-party components used in a software product, their versions and any known vulnerabilities.
77
SBOMs are essential for ensuring the security and integrity of software products, as they enable developers and security teams to identify and remediate vulnerabilities in a timely manner.
8-
In this blog post, we will discuss how to add SBOMs to your GitHub releases and JReleaser, and why it is essential.
8+
In this blog post, we will discuss how to add SBOMs to your GitHub and Maven Central releases and JReleaser, and why it is essential.
99

1010
## Requirements
1111

@@ -15,8 +15,8 @@ Here we show how to do it with maven and cyclonedx-maven-plugin.
1515

1616
## Goal
1717

18-
This blog post provides a step-by-step guide on adding SBOMs to your GitHub releases using Maven and JReleaser.
19-
We will cover the requirements for adding SBOMs, the benefits of doing so, and the steps involved in generating and adding an SBOM to your GitHub release.
18+
This blog post provides a step-by-step guide on adding SBOMs to your GitHub and Maven Central releases using Maven and JReleaser.
19+
We will cover the requirements for adding SBOMs, the benefits of doing so, and the steps involved in generating and adding an SBOM to your GitHub and Maven Central release.
2020
By the end of this post, you will clearly understand how to add SBOMs to your software releases and why it is crucial to do so.
2121

2222
## Steps
@@ -45,8 +45,8 @@ By the end of this post, you will clearly understand how to add SBOMs to your so
4545

4646
This will generate a bom.xml file in the target directory. We use the `makeAggregateBom` goal to have a single sbom for all the modules of our project.
4747

48-
2. Add the bom.xml and bom.json to your release script.
49-
If you have the JReleaser YAML file, you can add the bom.xml to the files section of the release section.
48+
2. (GitHub) Add the bom.xml and bom.json to your release script.
49+
If you have the JReleaser YAML file, you can add the bom.xml to the files section of the release section. This only affects the GitHub release.
5050

5151
```yaml
5252
files:
@@ -58,9 +58,23 @@ By the end of this post, you will clearly understand how to add SBOMs to your so
5858
5959
This adds the bom.xml and bom.json to the release assets.
6060
61-
3. Make a release :)
62-
The final result looks like this: https://github.com/chains-project/maven-lockfile/releases/tag/v3.0.0
61+
3. (Maven Central) JReleaser automatically uploads the SBOMs to Maven Central from version 1.6.0, if there is file matching the SBOM file name convention.
62+
Warning: If using the `jreleaser/release-action` action, be aware that even if you use the latest version of the action it can pull different versions of JReleaser, it must be >= 1.6.0.
63+
See example from `maven-lockfile` release action:
6364

64-
## Conclusion
65-
In conclusion, adding SBOMs to your GitHub releases is a simple and effective way to improve the security and integrity of your software products. Following the steps outlined in this blog post, you can easily generate and add an SBOM to your GitHub release using Maven and JReleaser. With an SBOM, you can identify and remediate vulnerabilities in your software products on time, reducing the risk of security breaches and ensuring the trust of your users. We hope this post has helped guide you through adding SBOMs to your GitHub releases, and we encourage you to continue exploring ways to improve the security and quality of your software products.
65+
```yml
66+
- name: Run JReleaser
67+
uses: jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8
68+
with:
69+
version: 1.15.0
70+
arguments: full-release
71+
env:
72+
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
73+
[...]
74+
```
6675

76+
4. Make a release :)
77+
The final result looks like this on GitHub: https://github.com/chains-project/maven-lockfile/releases/tag/v5.3.5 and like this on Maven Central: https://repo1.maven.org/maven2/io/github/chains-project/maven-lockfile/5.3.5/.
78+
79+
## Conclusion
80+
In conclusion, adding SBOMs to your GitHub and Maven Central releases is a simple and effective way to improve the security and integrity of your software products. Following the steps outlined in this blog post, you can easily generate and add an SBOM to your GitHub and Maven Central release using Maven and JReleaser. With an SBOM, you can identify and remediate vulnerabilities in your software products on time, reducing the risk of security breaches and ensuring the trust of your users. We hope this post has helped guide you through adding SBOMs to your GitHub and Maven Central releases, and we encourage you to continue exploring ways to improve the security and quality of your software products.

0 commit comments

Comments
 (0)