The Paketo Maven Buildpack is a Cloud Native Buildpack that builds Maven-based applications from source.
This buildpack will participate all the following conditions are met
<APPLICATION_ROOT>/pom.xml
exists
The buildpack will do the following:
- Requests that a JDK be installed
- Links the
~/.m2
to a layer for caching - If
<APPLICATION_ROOT>/mvnw
exists- Runs
<APPLICATION_ROOT>/mvnw -Dmaven.test.skip=true package
to build the application
- Runs
- If
<APPLICATION_ROOT>/mvnw
does not exist- Contributes Maven to a layer with all commands on
$PATH
- Runs
<MAVEN_ROOT>/bin/mvn -Dmaven.test.skip=true package
to build the application
- Contributes Maven to a layer with all commands on
- Removes the source code in
<APPLICATION_ROOT>
- Expands
<APPLICATION_ROOT>/target/*.[jw]ar
to<APPLICATION_ROOT>
Environment Variable | Description |
---|---|
$BP_MAVEN_BUILD_ARGUMENTS |
Configure the arguments to pass to Maven. Defaults to -Dmaven.test.skip=true package . --batch-mode will be prepended to the argument list in environments without a TTY. |
$BP_MAVEN_BUILT_MODULE |
Configure the module to find application artifact in. Defaults to the root module (empty). |
$BP_MAVEN_BUILT_ARTIFACT |
Configure the built application artifact explicitly. Supersedes $BP_MAVEN_BUILT_MODULE Defaults to target/*.[jw]ar . |
The buildpack optionally accepts the following bindings:
Secret | Description |
---|---|
settings.xml |
If present --settings=<path/to/settings.xml> is prepended to the maven arguments |
settings-security.xml |
If present -Dsettings.security=<path/to/settings-security.xml> is prepended to the maven arguments |
Key | Value | Description |
---|---|---|
<dependency-digest> |
<uri> |
If needed, the buildpack will fetch the dependency with digest <dependency-digest> from <uri> |
This buildpack is released under version 2.0 of the Apache License.