Skip to content

Commit 4429e84

Browse files
committed
Merge branch '3.3.x'
Closes gh-42629
2 parents d583bde + 5754be3 commit 4429e84

File tree

4 files changed

+45
-26
lines changed

4 files changed

+45
-26
lines changed

buildSrc/src/main/resources/org/springframework/boot/build/antora/antora-asciidoc-attributes.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ include-kotlin= ROOT:example$kotlin/org/springframework/boot/docs
77

88
url-ant-docs=https://ant.apache.org/manual
99
url-buildpacks-docs=https://buildpacks.io/docs
10+
url-cyclonedx-docs-gradle-plugin=https://github.com/CycloneDX/cyclonedx-gradle-plugin
11+
url-cyclonedx-docs-maven-plugin=https://github.com/CycloneDX/cyclonedx-maven-plugin
12+
url-download-liberica-nik=https://bell-sw.com/pages/downloads/native-image-kit/#/nik-22-17
1013
url-dynatrace-docs=https://docs.dynatrace.com/docs
1114
url-dynatrace-docs-shortlink={url-dynatrace-docs}/shortlink
1215
url-github-raw=https://github.com/raw/{github-repo}/{github-ref}
@@ -25,7 +28,6 @@ url-gradle-javadoc=https://docs.gradle.org/current/javadoc
2528
url-kotlin-docs-kotlin-plugin={url-kotlin-docs}/using-gradle.html
2629
url-micrometer-docs-concepts={url-micrometer-docs}/concepts
2730
url-micrometer-docs-implementations={url-micrometer-docs}/implementations
28-
url-download-liberica-nik=https://bell-sw.com/pages/downloads/native-image-kit/#/nik-22-17
2931
url-native-build-tools-docs=https://graalvm.github.io/native-build-tools/{version-native-build-tools}
3032
url-native-build-tools-docs-gradle-plugin={url-native-build-tools-docs}/gradle-plugin.html
3133
url-native-build-tools-docs-maven-plugin={url-native-build-tools-docs}/maven-plugin.html

spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/build.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,37 @@ Using this format lets the time be parsed into a `Date` and its format, when ser
8787

8888

8989

90+
[[howto.build.generate-cyclonedx-sbom]]
91+
== Generate a CycloneDX SBOM
92+
93+
Both Maven and Gradle allow generating a CycloneDX SBOM at project build time.
94+
95+
For Maven users, the `spring-boot-starter-parent` POM includes a pre-configured plugin to generate the SBOM.
96+
To use it, add the following declaration for the {url-cyclonedx-docs-maven-plugin}[`cyclonedx-maven-plugin`] to your POM:
97+
98+
[source,xml]
99+
----
100+
<build>
101+
<plugins>
102+
<plugin>
103+
<groupId>org.cyclonedx</groupId>
104+
<artifactId>cyclonedx-maven-plugin</artifactId>
105+
</plugin>
106+
</plugins>
107+
</build>
108+
----
109+
110+
Gradle users can achieve the same result by using the {url-cyclonedx-docs-gradle-plugin}[`cyclonedx-gradle-plugin`] plugin, as shown in the following example:
111+
112+
[source,gradle]
113+
----
114+
plugins {
115+
id 'org.cyclonedx.bom' version '1.10.0'
116+
}
117+
----
118+
119+
120+
90121
[[howto.build.customize-dependency-versions]]
91122
== Customize Dependency Versions
92123

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,33 +1275,10 @@ If you reach the `info` endpoint, you should see a response that contains the fo
12751275
The `sbom` endpoint exposes the https://en.wikipedia.org/wiki/Software_supply_chain[Software Bill of Materials].
12761276
CycloneDX SBOMs can be auto-detected, but other formats can be manually configured, too.
12771277

1278-
The `spring-boot-starter-parent` Maven parent and the Spring Boot Gradle plugin configure the https://github.com/CycloneDX/cyclonedx-maven-plugin[CycloneDX Maven plugin] and the https://github.com/CycloneDX/cyclonedx-gradle-plugin[CycloneDX Gradle plugin] respectively.
1279-
1280-
To get a CycloneDX SBOM, you'll need to add this to your Maven build:
1281-
1282-
[source,xml]
1283-
----
1284-
<build>
1285-
<plugins>
1286-
<plugin>
1287-
<groupId>org.cyclonedx</groupId>
1288-
<artifactId>cyclonedx-maven-plugin</artifactId>
1289-
</plugin>
1290-
</plugins>
1291-
</build>
1292-
----
1293-
1294-
For Gradle, you'll need to apply the CycloneDX Gradle plugin:
1295-
1296-
[source,groovy]
1297-
----
1298-
plugins {
1299-
id 'org.cyclonedx.bom' version '1.10.0'
1300-
}
1301-
----
1302-
13031278
The `sbom` actuator endpoint will then expose an SBOM called "application", which describes the contents of your application.
13041279

1280+
TIP: To automatically generate a CycloneDX SBOM at project build time, please see the xref:how-to:build.adoc#howto.build.generate-cyclonedx-sbom[] section.
1281+
13051282

13061283

13071284
[[actuator.endpoints.sbom.other-formats]]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/reacting.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,12 @@ When the {url-native-build-tools-docs-gradle-plugin}[GraalVM Native Image plugin
9292
. Configures the `bootJar` task to add the `Spring-Boot-Native-Processed: true` manifest entry.
9393

9494

95+
96+
[[reacting-to-other-plugins.cyclonedx]]
97+
== Reacting to the CycloneDX Plugin
98+
99+
When the {url-cyclonedx-docs-gradle-plugin}[CycloneDX plugin] is applied to a project, the Spring Boot plugin:
100+
101+
. Configures the `cyclonedxBom` task to use the `application` project type and output the SBOM to the `application.cdx` file in JSON format without full license texts.
102+
. Adds the SBOM under `META-INF/sbom` in the generated jar or war file.
103+
. Adds the `Sbom-Format` and `Sbom-Location` to the manifest of the jar or war file.

0 commit comments

Comments
 (0)