Skip to content

Commit

Permalink
Enhance README
Browse files Browse the repository at this point in the history
* to explain how to
  * work with CNB and varying versions of Spring Boot
  * adapt configuration for exposing endpoints
  • Loading branch information
pacphi committed May 26, 2024
1 parent 88e4e60 commit 98b9308
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,24 @@ Among several sub-directories underneath the `layers/sbom/launch` directory, you
+- sbom.syft.json
```

Unfortunately, these files are not available and accessible in the container image at runtime. But what you can do is make a copy of the `sbom.cdx.json` file, like so:
Unfortunately, these files are not available and accessible in the container image at runtime. But what you can do is make a copy of the `sbom.cdx.json` file.

Set a variable name.

For applications with dependencies on Spring Boot 3.2, set

```
SBOM_FILENAME=sbom.json
```

For applications with dependencies on Spring Boot 3.3 or better, set

```
cp -f layers/sbom/launch/paketo-buildpacks_executable-jar/sbom.cdx.json src/main/resources/META-INF/sbom/application.cdx.json
SBOM_FILENAME=META-INF/sbom/application.cdx.json
```

```
cp -f layers/sbom/launch/paketo-buildpacks_executable-jar/sbom.cdx.json src/main/resources/$SBOM_FILENAME
```

Then rebuild the container image. (Remember to repeat this process for any change you make to source).
Expand Down Expand Up @@ -202,6 +216,15 @@ And if you want to expose the `/actuator/info`, `/actuator/jars` and `/actuator/
```
> where `endpoints` above is a sibling of (shares the same indentation as) `info`
Also, note if you want to expose the `/actuator/sbom` endpoint, available since Spring Boot 3.3, you'll need to update the above to be

```
endpoints:
web:
exposure:
include: "health,info,jars,pom,sbom"
```

Build your application, then start it up.

Visit the above-mentioned custom [actuator endpoints](https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html).
Expand Down

0 comments on commit 98b9308

Please sign in to comment.