Class BuildRequest
java.lang.Object
org.springframework.boot.buildpack.platform.build.BuildRequest
A build request to be handled by the 
Builder.- Since:
- 2.3.0
- Author:
- Phillip Webb, Scott Frederick, Andrey Shlykov, Jeroen Meijer, Rafael Ceccone, Julian Liebig
- 
Method SummaryModifier and TypeMethodDescriptionstatic BuildRequestforJarFile(File jarFile) Factory method to create a newBuildRequestfrom a JAR file.static BuildRequestforJarFile(ImageReference name, File jarFile) Factory method to create a newBuildRequestfrom a JAR file.getApplicationContent(Owner owner) Return aTarArchivecontaining the application content that the buildpack should package.Return the application directory that should be used by the lifecycle.Return the collection of bindings to mount to the build container.Return the custom build cache that should be used by the lifecycle.Return the builder that should be used.Return the collection of buildpacks to use when building the image, if provided.Return the build workspace that should be used by the lifecycle.Return the custom created date that should be used by the lifecycle.Return theCreatorthe builder should use.getEnv()Return any env variable that should be passed to the builder.Return the platform that should be used when pulling images.Return the custom launch cache that should be used by the lifecycle.getName()Return the name of the image that should be created.Return the network the build container will connect to.Return the imagePullPolicythat the builder should use.Return the run image that should be used, if provided.Return the security options that should be used by the lifecycle.getTags()Return the collection of tags that should be created.booleanReturn if caches should be cleaned before packaging.booleanReturn if the built image should be pushed to a registry.booleanReturn whether the builder should be treated as trusted.booleanReturn if verbose logging output should be used.static BuildRequestof(ImageReference name, Function<Owner, TarArchive> applicationContent) Factory method to create a newBuildRequestwith specific content.withApplicationDirectory(String applicationDirectory) Return a newBuildRequestwith an updated application directory.withBindings(List<Binding> bindings) Return a newBuildRequestwith updated bindings.withBindings(Binding... bindings) Return a newBuildRequestwith updated bindings.withBuildCache(Cache buildCache) Return a newBuildRequestwith an updated build cache.withBuilder(ImageReference builder) Return a newBuildRequestwith an updated builder.withBuildpacks(List<BuildpackReference> buildpacks) Return a newBuildRequestwith an updated buildpacks setting.withBuildpacks(BuildpackReference... buildpacks) Return a newBuildRequestwith an updated buildpacks setting.withBuildWorkspace(Cache buildWorkspace) Return a newBuildRequestwith an updated build workspace.withCleanCache(boolean cleanCache) Return a newBuildRequestwith an updated clean cache setting.withCreatedDate(String createdDate) Return a newBuildRequestwith an updated created date.withCreator(Creator creator) Return a newBuildRequestwith an updated creator.Return a newBuildRequestwith an additional env variable.Return a newBuildRequestwith additional env variables.withImagePlatform(String platform) Return a newBuildRequestwith an updated image platform.withLaunchCache(Cache launchCache) Return a newBuildRequestwith an updated launch cache.withNetwork(String network) Return a newBuildRequestwith an updated network setting.withPublish(boolean publish) Return a newBuildRequestwith an updated publish setting.withPullPolicy(PullPolicy pullPolicy) Return a newBuildRequestwith the updated image pull policy.withRunImage(ImageReference runImageName) Return a newBuildRequestwith an updated run image.withSecurityOptions(List<String> securityOptions) Return a newBuildRequestwith an updated security options.withTags(List<ImageReference> tags) Return a newBuildRequestwith updated tags.withTags(ImageReference... tags) Return a newBuildRequestwith updated tags.withTrustBuilder(boolean trustBuilder) Return a newBuildRequestwith an updated trust builder setting.withVerboseLogging(boolean verboseLogging) Return a newBuildRequestwith an updated verbose logging setting.
- 
Method Details- 
withBuilderReturn a newBuildRequestwith an updated builder.- Parameters:
- builder- the new builder to use
- Returns:
- an updated build request
 
- 
withTrustBuilderReturn a newBuildRequestwith an updated trust builder setting.- Parameters:
- trustBuilder-- trueif the builder should be treated as trusted,- falseotherwise
- Returns:
- an updated build request
- Since:
- 3.4.0
 
- 
withRunImageReturn a newBuildRequestwith an updated run image.- Parameters:
- runImageName- the run image to use
- Returns:
- an updated build request
 
- 
withCreatorReturn a newBuildRequestwith an updated creator.- Parameters:
- creator- the new- Creatorto use
- Returns:
- an updated build request
 
- 
withEnvReturn a newBuildRequestwith an additional env variable.- Parameters:
- name- the variable name
- value- the variable value
- Returns:
- an updated build request
 
- 
withEnvReturn a newBuildRequestwith additional env variables.- Parameters:
- env- the additional variables
- Returns:
- an updated build request
 
- 
withCleanCacheReturn a newBuildRequestwith an updated clean cache setting.- Parameters:
- cleanCache- if the cache should be cleaned
- Returns:
- an updated build request
 
- 
withVerboseLoggingReturn a newBuildRequestwith an updated verbose logging setting.- Parameters:
- verboseLogging- if verbose logging should be used
- Returns:
- an updated build request
 
- 
withPullPolicyReturn a newBuildRequestwith the updated image pull policy.- Parameters:
- pullPolicy- image pull policy- PullPolicy
- Returns:
- an updated build request
 
- 
withPublishReturn a newBuildRequestwith an updated publish setting.- Parameters:
- publish- if the built image should be pushed to a registry
- Returns:
- an updated build request
 
- 
withBuildpacksReturn a newBuildRequestwith an updated buildpacks setting.- Parameters:
- buildpacks- a collection of buildpacks to use when building the image
- Returns:
- an updated build request
- Since:
- 2.5.0
 
- 
withBuildpacksReturn a newBuildRequestwith an updated buildpacks setting.- Parameters:
- buildpacks- a collection of buildpacks to use when building the image
- Returns:
- an updated build request
- Since:
- 2.5.0
 
- 
withBindingsReturn a newBuildRequestwith updated bindings.- Parameters:
- bindings- a collection of bindings to mount to the build container
- Returns:
- an updated build request
- Since:
- 2.5.0
 
- 
withBindingsReturn a newBuildRequestwith updated bindings.- Parameters:
- bindings- a collection of bindings to mount to the build container
- Returns:
- an updated build request
- Since:
- 2.5.0
 
- 
withNetworkReturn a newBuildRequestwith an updated network setting.- Parameters:
- network- the network the build container will connect to
- Returns:
- an updated build request
- Since:
- 2.6.0
 
- 
withTagsReturn a newBuildRequestwith updated tags.- Parameters:
- tags- a collection of tags to be created for the built image
- Returns:
- an updated build request
 
- 
withTagsReturn a newBuildRequestwith updated tags.- Parameters:
- tags- a collection of tags to be created for the built image
- Returns:
- an updated build request
 
- 
withBuildWorkspaceReturn a newBuildRequestwith an updated build workspace.- Parameters:
- buildWorkspace- the build workspace
- Returns:
- an updated build request
- Since:
- 3.2.0
 
- 
withBuildCacheReturn a newBuildRequestwith an updated build cache.- Parameters:
- buildCache- the build cache
- Returns:
- an updated build request
 
- 
withLaunchCacheReturn a newBuildRequestwith an updated launch cache.- Parameters:
- launchCache- the cache
- Returns:
- an updated build request
 
- 
withCreatedDateReturn a newBuildRequestwith an updated created date.- Parameters:
- createdDate- the created date
- Returns:
- an updated build request
 
- 
withApplicationDirectoryReturn a newBuildRequestwith an updated application directory.- Parameters:
- applicationDirectory- the application directory
- Returns:
- an updated build request
 
- 
withSecurityOptionsReturn a newBuildRequestwith an updated security options.- Parameters:
- securityOptions- the security options
- Returns:
- an updated build request
- Since:
- 3.2.0
 
- 
withImagePlatformReturn a newBuildRequestwith an updated image platform.- Parameters:
- platform- the image platform
- Returns:
- an updated build request
- Since:
- 3.4.0
 
- 
getNameReturn the name of the image that should be created.- Returns:
- the name of the image
 
- 
getApplicationContentReturn aTarArchivecontaining the application content that the buildpack should package. This is typically the contents of the Jar.- Parameters:
- owner- the owner of the tar entries
- Returns:
- the application content
- See Also:
 
- 
getBuilderReturn the builder that should be used.- Returns:
- the builder to use
 
- 
isTrustBuilderpublic boolean isTrustBuilder()Return whether the builder should be treated as trusted.- Returns:
- the trust builder flag
- Since:
- 3.4.0
 
- 
getRunImageReturn the run image that should be used, if provided.- Returns:
- the run image
 
- 
getCreatorReturn theCreatorthe builder should use.- Returns:
- the Creator
 
- 
getEnvReturn any env variable that should be passed to the builder.- Returns:
- the builder env
 
- 
isCleanCachepublic boolean isCleanCache()Return if caches should be cleaned before packaging.- Returns:
- if caches should be cleaned
 
- 
isVerboseLoggingpublic boolean isVerboseLogging()Return if verbose logging output should be used.- Returns:
- if verbose logging should be used
 
- 
isPublishpublic boolean isPublish()Return if the built image should be pushed to a registry.- Returns:
- if the built image should be pushed to a registry
 
- 
getPullPolicyReturn the imagePullPolicythat the builder should use.- Returns:
- image pull policy
 
- 
getBuildpacksReturn the collection of buildpacks to use when building the image, if provided.- Returns:
- the buildpacks
 
- 
getBindingsReturn the collection of bindings to mount to the build container.- Returns:
- the bindings
- Since:
- 2.5.0
 
- 
getNetworkReturn the network the build container will connect to.- Returns:
- the network
- Since:
- 2.6.0
 
- 
getTagsReturn the collection of tags that should be created.- Returns:
- the tags
 
- 
getBuildWorkspaceReturn the build workspace that should be used by the lifecycle.- Returns:
- the build workspace or null
- Since:
- 3.2.0
 
- 
getBuildCacheReturn the custom build cache that should be used by the lifecycle.- Returns:
- the build cache
 
- 
getLaunchCacheReturn the custom launch cache that should be used by the lifecycle.- Returns:
- the launch cache
 
- 
getCreatedDateReturn the custom created date that should be used by the lifecycle.- Returns:
- the created date
 
- 
getApplicationDirectoryReturn the application directory that should be used by the lifecycle.- Returns:
- the application directory
 
- 
getSecurityOptionsReturn the security options that should be used by the lifecycle.- Returns:
- the security options or null
- Since:
- 3.2.0
 
- 
getImagePlatformReturn the platform that should be used when pulling images.- Returns:
- the platform or null
- Since:
- 3.4.0
 
- 
forJarFileFactory method to create a newBuildRequestfrom a JAR file.- Parameters:
- jarFile- the source jar file
- Returns:
- a new build request instance
 
- 
forJarFileFactory method to create a newBuildRequestfrom a JAR file.- Parameters:
- name- the name of the image that should be created
- jarFile- the source jar file
- Returns:
- a new build request instance
 
- 
ofFactory method to create a newBuildRequestwith specific content.- Parameters:
- name- the name of the image that should be created
- applicationContent- function to provide the application content
- Returns:
- a new build request instance
 
 
-