Documentation
¶
Overview ¶
* Copyright 2018-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- Variables
- func DataFlowConfigurationExists(path string) (bool, error)
- func FindExistingDependency(jars []libjvm.MavenJAR, dependencyName string) bool
- type ApplicationType
- type Build
- type ConfigurationMetadata
- type Deprecation
- type Detect
- type Generation
- type GenerationValidator
- type Group
- type Hint
- type NativeImageClasspath
- type Project
- type Projects
- type Property
- type SpringCloudBindings
- type SpringPerformance
- type ValueHint
- type ValueProvider
- type WebApplicationType
- type WebApplicationTypeResolver
Constants ¶
const ( LabelSpringBootVersion = "org.springframework.boot.version" LabelImageTitle = "org.opencontainers.image.title" LabelImageVersion = "org.opencontainers.image.version" LabelBootConfigurationMetadata = "org.springframework.boot.spring-configuration-metadata.json" LabelDataFlowConfigurationMetadata = "org.springframework.cloud.dataflow.spring-configuration-metadata.json" SpringCloudBindingsBoot2 = "1" SpringCloudBindingsBoot3 = "2" FileSystemProvider = "java.nio.file.spi.FileSystemProvider" NestedFileSystemProvider = "org.springframework.boot.loader.nio.file.NestedFileSystemProvider" )
const ( PlanEntrySpringBoot = "spring-boot" PlanEntryJVMApplication = "jvm-application" PlanEntryNativeProcessed = "native-processed" PlanEntryJRE = "jre" MavenConfigActiveProfiles = "BP_MAVEN_ACTIVE_PROFILES" )
const ( WebMVCIndicatorClass = "org.springframework.web.servlet.DispatcherServlet" WebFluxIndicatorClass = "org.springframework.web.reactive.DispatcherHandler" JerseyIndicatorClass = "org.glassfish.jersey.servlet.ServletContainer" ConfigurableWebApplicationContextIndicatorClass = "org.springframework.web.context.ConfigurableWebApplicationContext" JakartaServlet = "jakarta.servlet.Servlet" JavaxServlet = "javax.servlet.Servlet" )
const DatePattern = "2006-01-02"
Variables ¶
var ( MaxDate = time.Unix(1<<63-62135596801, 999999999) Warningf = color.New(color.FgYellow, color.Bold, color.Faint).SprintfFunc() NormalizedVersion = regexp.MustCompile(`[\d]+(?:\.[\d]+(?:\.[\d]+)?)?`) )
var ServletIndicatorClasses = []string{ JavaxServlet, JakartaServlet, }
Functions ¶
Types ¶
type ApplicationType ¶
type ApplicationType uint8
const ( None ApplicationType = iota Reactive Servlet )
type Build ¶
func (Build) Build ¶
func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error)
type ConfigurationMetadata ¶
type ConfigurationMetadata struct { Groups []Group `json:"groups,omitempty"` Properties []Property `json:"properties,omitempty"` Hints []Hint `json:"hints,omitempty"` }
func NewConfigurationMetadataFromJAR ¶
func NewConfigurationMetadataFromJAR(jar string) (ConfigurationMetadata, error)
func NewConfigurationMetadataFromPath ¶
func NewConfigurationMetadataFromPath(path string) (ConfigurationMetadata, error)
func NewDataFlowConfigurationMetadata ¶
func NewDataFlowConfigurationMetadata(path string, metadata ConfigurationMetadata) (ConfigurationMetadata, error)
type Deprecation ¶
type Detect ¶
func (Detect) Detect ¶
func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error)
type Generation ¶
type Generation struct { Name *semver.Constraints `toml:"name"` OSS time.Time `toml:"oss"` Commercial time.Time `toml:"commercial"` }
func (*Generation) UnmarshalTOML ¶
func (g *Generation) UnmarshalTOML(data interface{}) error
type GenerationValidator ¶
func NewGenerationValidator ¶
func NewGenerationValidator(path string) (GenerationValidator, error)
type Hint ¶
type Hint struct { Name string `json:"name"` Values []ValueHint `json:"values,omitempty"` Providers []ValueProvider `json:"providers,omitempty"` }
type NativeImageClasspath ¶
type NativeImageClasspath struct { Logger bard.Logger ApplicationPath string Manifest *properties.Properties }
func NewNativeImageClasspath ¶
func NewNativeImageClasspath(appDir string, manifest *properties.Properties) (NativeImageClasspath, error)
func (NativeImageClasspath) Contribute ¶
Contribute appends application classes and entries from classpath.idx to the build time classpath.
In a JVM application the Spring Boot Loader would make these modifications to the classpath when the executable JAR or WAR is launched. To set the classpath properly for a native-image build the buildpack must replicate this behavior.
func (NativeImageClasspath) Name ¶
func (NativeImageClasspath) Name() string
type Project ¶
type Project struct { Name string `toml:"name"` Slug string `toml:"slug"` Status string `toml:"status"` Generations []Generation `toml:"generations"` }
type Property ¶
type Property struct { Name string `json:"name"` Type string `json:"type,omitempty"` Description string `json:"description,omitempty"` SourceType string `json:"sourceType,omitempty"` DefaultValue interface{} `json:"defaultValue,omitempty"` Deprecation *Deprecation `json:"deprecation,omitempty"` }
type SpringCloudBindings ¶
type SpringCloudBindings struct { Dependency libpak.BuildpackDependency LayerContributor libpak.DependencyLayerContributor Logger bard.Logger SpringBootLib string }
func NewSpringCloudBindings ¶
func NewSpringCloudBindings(springBootLib string, dependency libpak.BuildpackDependency, cache libpak.DependencyCache) (SpringCloudBindings, libcnb.BOMEntry)
func (SpringCloudBindings) Contribute ¶
func (SpringCloudBindings) Name ¶
func (s SpringCloudBindings) Name() string
type SpringPerformance ¶ added in v5.29.0
type SpringPerformance struct { Dependency libpak.BuildpackDependency LayerContributor libpak.LayerContributor Logger bard.Logger Executor effect.Executor AppPath string Manifest *properties.Properties AotEnabled bool DoTrainingRun bool ClasspathString string ReZip bool TrainingRunJavaToolOptions string }
func NewSpringPerformance ¶ added in v5.29.0
func NewSpringPerformance(cache libpak.DependencyCache, appPath string, manifest *properties.Properties, aotEnabled bool, doTrainingRun bool, classpathString string, reZip bool, trainingRunJavaToolOptions string) SpringPerformance
func (SpringPerformance) Contribute ¶ added in v5.29.0
func (SpringPerformance) Name ¶ added in v5.29.0
func (s SpringPerformance) Name() string
type ValueHint ¶
type ValueHint struct { Value interface{} `json:"value"` Description string `json:"description,omitempty"` }
type ValueProvider ¶
type WebApplicationType ¶
type WebApplicationType struct { LayerContributor libpak.LayerContributor Logger bard.Logger Resolver WebApplicationTypeResolver }
func NewWebApplicationType ¶
func NewWebApplicationType(applicationPath string, resolver WebApplicationTypeResolver) (WebApplicationType, error)
func (WebApplicationType) Contribute ¶
func (WebApplicationType) Name ¶
func (WebApplicationType) Name() string
type WebApplicationTypeResolver ¶
type WebApplicationTypeResolver struct {
Classes map[string]interface{}
}
func NewWebApplicationResolver ¶
func NewWebApplicationResolver(classes string, lib string) (WebApplicationTypeResolver, error)
func (WebApplicationTypeResolver) Resolve ¶
func (w WebApplicationTypeResolver) Resolve() ApplicationType