libjvm

package module
v1.44.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 32 Imported by: 38

README

github.com/paketo-buildpacks/libjvm

libjvm is a Go library and helper applications that form the basis for building the different Paketo-style JVM-providing buildpacks.

Usage

go get github.com/paketo-buildpacks/libjvm

License

This library is released under version 2.0 of the Apache License.

Documentation

Index

Constants

View Source
const (
	PlanEntryNativeImageBuilder = "native-image-builder"
	PlanEntryJRE                = "jre"
	PlanEntryJDK                = "jdk"
)
View Source
const DefaultCertFile = "/etc/ssl/certs/ca-certificates.crt"

Variables

View Source
var Java18, _ = semver.NewVersion("18")
View Source
var Java9, _ = semver.NewVersion("9")
View Source
var NormalizedDateTime = time.Date(1980, time.January, 1, 0, 0, 1, 0, time.UTC)

Functions

func IsBeforeJava18 added in v1.36.1

func IsBeforeJava18(candidate string) bool

func IsBeforeJava9 added in v1.12.0

func IsBeforeJava9(candidate string) bool

func IsBuildContribution added in v1.11.1

func IsBuildContribution(metadata map[string]interface{}) bool

func IsLaunchContribution added in v1.11.1

func IsLaunchContribution(metadata map[string]interface{}) bool

func NewManifest added in v1.2.0

func NewManifest(applicationPath string) (*properties.Properties, error)

NewManifest reads the <APP>/META-INF/MANIFEST.MF file if it exists, normalizing it into the standard properties form.

func NewManifestFromJAR added in v1.36.0

func NewManifestFromJAR(jarFilePath string) (*properties.Properties, error)

NewManifestFromJAR reads the META-INF/MANIFEST.MF from a JAR file if it exists, normalizing it into the standard properties form.

Types

type Build

type Build struct {
	Logger          bard.Logger
	Result          libcnb.BuildResult
	CertLoader      CertificateLoader
	DependencyCache libpak.DependencyCache
	Native          NativeImage
	CustomHelpers   []string
}

func NewBuild added in v1.38.0

func NewBuild(logger bard.Logger, buildOpts ...BuildOption) Build

func (Build) Build

func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error)

type BuildOption added in v1.38.0

type BuildOption func(build Build) Build

func WithCustomHelpers added in v1.38.0

func WithCustomHelpers(customHelpers []string) BuildOption

func WithNativeImage added in v1.38.0

func WithNativeImage(nativeImage NativeImage) BuildOption

type CertificateLoader added in v1.12.0

type CertificateLoader struct {
	CertFile string
	CertDirs []string
	Logger   io.Writer
}

func NewCertificateLoader added in v1.24.0

func NewCertificateLoader() CertificateLoader

func (*CertificateLoader) Load added in v1.12.0

func (c *CertificateLoader) Load(path string, password string) error

func (*CertificateLoader) Metadata added in v1.24.0

func (c *CertificateLoader) Metadata() (map[string]interface{}, error)

type Detect

type Detect struct{}

func (Detect) Detect

func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error)

type DistributionType added in v1.12.0

type DistributionType uint8
const (
	JDKType DistributionType = iota
	JREType
)

func (DistributionType) String added in v1.12.0

func (d DistributionType) String() string

type JDK

type JDK struct {
	CertificateLoader CertificateLoader
	LayerContributor  libpak.DependencyLayerContributor
	Logger            bard.Logger
}

func NewJDK

func NewJDK(dependency libpak.BuildpackDependency, cache libpak.DependencyCache, certificateLoader CertificateLoader) (JDK, libcnb.BOMEntry, error)

func (JDK) Contribute

func (j JDK) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (JDK) Name

func (j JDK) Name() string

type JKSKeystore added in v1.44.0

type JKSKeystore struct {
	// contains filtered or unexported fields
}

func NewJKSKeystore added in v1.44.0

func NewJKSKeystore(location, password string) (*JKSKeystore, error)

func (*JKSKeystore) Add added in v1.44.0

func (k *JKSKeystore) Add(name string, b *pem.Block) error

func (*JKSKeystore) Len added in v1.44.0

func (k *JKSKeystore) Len() int

func (*JKSKeystore) Write added in v1.44.0

func (k *JKSKeystore) Write() error
type JLink struct {
	LayerContributor  libpak.LayerContributor
	Logger            bard.Logger
	ApplicationPath   string
	Executor          effect.Executor
	CertificateLoader CertificateLoader
	Metadata          map[string]interface{}
	JavaVersion       string
	Args              []string
	UserConfigured    bool
}
func NewJLink(applicationPath string, exec effect.Executor, args []string, certificateLoader CertificateLoader, metadata map[string]interface{}, userConfigured bool) (JLink, error)

func (JLink) Contribute added in v1.38.0

func (j JLink) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (JLink) Name added in v1.38.0

func (j JLink) Name() string

type JRE

type JRE struct {
	ApplicationPath   string
	CertificateLoader CertificateLoader
	DistributionType  DistributionType
	LayerContributor  libpak.DependencyLayerContributor
	Logger            bard.Logger
	Metadata          map[string]interface{}
}

func NewJRE

func NewJRE(applicationPath string, dependency libpak.BuildpackDependency, cache libpak.DependencyCache, distributionType DistributionType, certificateLoader CertificateLoader, metadata map[string]interface{}) (JRE, libcnb.BOMEntry, error)

func (JRE) Contribute

func (j JRE) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (JRE) Name

func (j JRE) Name() string

type JVMVersion added in v1.34.0

type JVMVersion struct {
	Logger bard.Logger
}

func NewJVMVersion added in v1.37.0

func NewJVMVersion(logger bard.Logger) JVMVersion

func (JVMVersion) GetJVMVersion added in v1.34.0

func (j JVMVersion) GetJVMVersion(appPath string, cr libpak.ConfigurationResolver) (string, error)

type JavaSecurityProperties

type JavaSecurityProperties struct {
	LayerContributor libpak.LayerContributor
	Logger           bard.Logger
}

func NewJavaSecurityProperties

func NewJavaSecurityProperties(info libcnb.BuildpackInfo) JavaSecurityProperties

func (JavaSecurityProperties) Contribute

func (j JavaSecurityProperties) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (JavaSecurityProperties) Name

func (j JavaSecurityProperties) Name() string

type Keystore added in v1.44.0

type Keystore interface {
	Add(string, *pem.Block) error
	Write() error
}

func DetectKeystore added in v1.44.0

func DetectKeystore(location string) (Keystore, error)

type MavenJAR added in v1.10.0

type MavenJAR struct {

	// Name is the name of the JAR, without the version or extension.
	Name string `toml:"name"`

	// Version is the version of the JAR, without the name or extension.
	Version string `toml:"version"`

	// SHA256 is the SHA256 hash of the JAR.
	SHA256 string `toml:"sha256"`
}

MavenJAR is metadata about a JRE entry that follows Maven naming conventions.

func NewMavenJARListing added in v1.10.0

func NewMavenJARListing(roots ...string) ([]MavenJAR, error)

NewMavenJARListing generates a listing of all JAR that follow Maven naming convention under the roots.

type NIK added in v1.38.0

type NIK struct {
	CertificateLoader CertificateLoader
	DependencyCache   libpak.DependencyCache
	Executor          effect.Executor
	JDKDependency     libpak.BuildpackDependency
	LayerContributor  libpak.LayerContributor
	Logger            bard.Logger
	NativeDependency  *libpak.BuildpackDependency
	CustomCommand     string
	CustomArgs        []string
}

func NewNIK added in v1.38.0

func NewNIK(jdkDependency libpak.BuildpackDependency, nativeDependency *libpak.BuildpackDependency, cache libpak.DependencyCache, certificateLoader CertificateLoader, customCommand string, customArgs []string) (NIK, []libcnb.BOMEntry, error)

func (NIK) Contribute added in v1.38.0

func (n NIK) Contribute(layer libcnb.Layer) (libcnb.Layer, error)

func (NIK) Name added in v1.38.0

func (NIK) Name() string

type NativeImage added in v1.38.0

type NativeImage struct {
	BundledWithJDK bool
	CustomCommand  string
	CustomArgs     []string
}

type PasswordLessPKCS12Keystore added in v1.44.0

type PasswordLessPKCS12Keystore struct {
	// contains filtered or unexported fields
}

func NewPasswordLessPKCS12Keystore added in v1.44.0

func NewPasswordLessPKCS12Keystore(location string) (*PasswordLessPKCS12Keystore, error)

func (*PasswordLessPKCS12Keystore) Add added in v1.44.0

func (k *PasswordLessPKCS12Keystore) Add(name string, b *pem.Block) error

func (*PasswordLessPKCS12Keystore) Len added in v1.44.0

func (*PasswordLessPKCS12Keystore) Write added in v1.44.0

func (k *PasswordLessPKCS12Keystore) Write() error

type SDKInfo added in v1.37.0

type SDKInfo struct {
	Type    string
	Version string
	Vendor  string
}

SDKInfo represents the information from each line in the `.sdkmanrc` file

func ReadSDKMANRC added in v1.37.0

func ReadSDKMANRC(path string) ([]SDKInfo, error)

ReadSDKMANRC reads the `.sdkmanrc` format file from path and retuns the list of SDKS in it

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL