diff --git a/buildpacks/java/README.md b/buildpacks/java/README.md index 01bc5e28..3ea6da4d 100644 --- a/buildpacks/java/README.md +++ b/buildpacks/java/README.md @@ -4,18 +4,28 @@ The Java Function Buildpack is a Cloud Native Buildpack that provides a Spring B ## Behaviour This buildpack will participate if any of the following conditions are met: -* A file with the name `func.yaml` is detected +* One of the configuration environment variables are explicitly set. +* A file with the name `func.yaml` is detected. The buildpack will do the following if detection passed: * Request for a JRE to be installed * Contributes the Spring Boot application to a layer marked `launch` with the layer's path prepended to `$CLASSPATH` * Contributes environment variables defined in `func.yaml` to the `launch` layer +* Contributes environment variables to configure Spring Boot if any configuration variables are defined. (Overrides anything from `func.yaml`) + +## Configuration + +| Environment Variable | Description | +|----------------------|-------------| +| `$BP_FUNCTION` | Configure the composition of functions. Defaults to empty (load all functions). | +| `$BP_FUNCTION_PACKAGES` | Configure the package to search for functions. Defaults to `functions`. | + ## Getting started To get started you'll need to create a directory where your function will be defined. From within this directory we require a few files to properly detect this as a Java function: -* `func.yaml`: We use this to configure the runtime environment variables. See the [Knative Func CLI docs](https://github.com/knative-sandbox/kn-plugin-func/blob/main/docs/guides/func_yaml.md) for more details. +* `func.yaml` (optional): We use this to configure the runtime environment variables. See the [Knative Func CLI docs](https://github.com/knative-sandbox/kn-plugin-func/blob/main/docs/guides/func_yaml.md) for more details. * `pom.xml` or `build.gradle`: These are used by the other Java buildpacks to compile your function. * Java package in folder `src/main/java/functions`: This is the default location your function will be detected. If you do choose to use another package to store your functions, you will need to [set a new search location](#TODO).