java

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MAVEN_COMPILER_PLUGIN is the name of the maven plugin that compiles the java code.
	MAVEN_COMPILER_PLUGIN = "maven-compiler-plugin"
	// MAVEN_JAR_PLUGIN is the name of the maven plugin that packages the java code.
	MAVEN_JAR_PLUGIN = "maven-jar-plugin"
	// SPRING_BOOT_MAVEN_PLUGIN is the name of the maven plugin that Spring Boot uses.
	SPRING_BOOT_MAVEN_PLUGIN = "spring-boot-maven-plugin"
	// MAVEN_DEFAULT_BUILD_DIR is the name of the default build directory
	MAVEN_DEFAULT_BUILD_DIR = "target"
)
View Source
const (
	// NO_BUILD_STAGE don't generate the build stage in Dockerfiles
	NO_BUILD_STAGE buildOption = "no build stage"
	// BUILD_IN_BASE_IMAGE generate the build stage and put it in a separate Dockerfile
	BUILD_IN_BASE_IMAGE buildOption = "build stage in base image"
	// BUILD_IN_EVERY_IMAGE generate the build stage in every Dockerfile
	BUILD_IN_EVERY_IMAGE buildOption = "build stage in every image"
)
View Source
const (

	// JavaPackageNamesMappingKind defines kind of JavaPackageNamesMappingKind
	JavaPackageNamesMappingKind types.Kind = "JavaPackageVersions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EarAnalyser

type EarAnalyser struct {
	Config    transformertypes.Transformer
	Env       *environment.Environment
	EarConfig *EarYamlConfig
}

EarAnalyser implements Transformer interface

func (*EarAnalyser) DirectoryDetect

func (t *EarAnalyser) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*EarAnalyser) GetConfig

GetConfig returns the transformer config

func (*EarAnalyser) Init

Init Initializes the transformer

func (*EarAnalyser) Transform

func (t *EarAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type EarDockerfileTemplate

type EarDockerfileTemplate struct {
	DeploymentFile                    string
	BuildContainerName                string
	DeploymentFileDirInBuildContainer string
	EnvVariables                      map[string]string
}

EarDockerfileTemplate stores parameters for the dockerfile template

type EarYamlConfig

type EarYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
}

EarYamlConfig stores the war related information

type FlattenedProperty

type FlattenedProperty struct {
	Name  string
	Value string
}

FlattenedProperty defines the key value pair of the spring boot properties

type GradleAnalyser

type GradleAnalyser struct {
	Config       transformertypes.Transformer
	Env          *environment.Environment
	GradleConfig *GradleYamlConfig
}

GradleAnalyser implements Transformer interface

func (*GradleAnalyser) DirectoryDetect

func (t *GradleAnalyser) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*GradleAnalyser) GetConfig

GetConfig returns the transformer config

func (*GradleAnalyser) Init

Init Initializes the transformer

func (*GradleAnalyser) Transform

func (t *GradleAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the input artifacts, mostly handles artifacts created during the plan phase.

func (*GradleAnalyser) TransformArtifact added in v0.3.3

func (t *GradleAnalyser) TransformArtifact(newArtifact transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact, serviceConfig artifacts.ServiceConfig, gradleConfig artifacts.GradleConfig) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

TransformArtifact transforms a single artifact.

type GradleBuildDockerfileTemplate

type GradleBuildDockerfileTemplate struct {
	GradlewPresent     bool
	JavaPackageName    string
	GradleVersion      string
	BuildContainerName string
	GradleProperties   map[string]string
	EnvVariables       map[string]string
}

GradleBuildDockerfileTemplate defines the information for the build dockerfile template

type GradleYamlConfig

type GradleYamlConfig struct {
	GradleVersion           string `yaml:"defaultGradleVersion"`
	JavaVersion             string `yaml:"defaultJavaVersion"`
	AppPathInBuildContainer string `yaml:"appPathInBuildContainer"`
}

GradleYamlConfig stores the Gradle related information

type JarAnalyser

type JarAnalyser struct {
	Config    transformertypes.Transformer
	Env       *environment.Environment
	JarConfig *JarYamlConfig
}

JarAnalyser implements Transformer interface

func (*JarAnalyser) DirectoryDetect

func (t *JarAnalyser) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*JarAnalyser) GetConfig

GetConfig returns the transformer config

func (*JarAnalyser) Init

Init Initializes the transformer

func (*JarAnalyser) Transform

func (t *JarAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type JarDockerfileTemplate

type JarDockerfileTemplate struct {
	Port               int32
	JavaPackageName    string
	BuildContainerName string
	DeploymentFilePath string
	DeploymentFilename string
	EnvVariables       map[string]string
}

JarDockerfileTemplate stores parameters for the dockerfile template

type JarYamlConfig

type JarYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
	DefaultPort int32  `yaml:"defaultPort"`
}

JarYamlConfig stores jar related configuration information

type JavaLibertyImageMapping

type JavaLibertyImageMapping struct {
	types.TypeMeta   `yaml:",inline"`
	types.ObjectMeta `yaml:"metadata,omitempty"`
	Spec             JavaLibertyImageMappingSpec `yaml:"spec,omitempty"`
}

JavaLibertyImageMapping stores the java version to liberty image version mappings

type JavaLibertyImageMappingSpec

type JavaLibertyImageMappingSpec struct {
	Mapping map[string]string `yaml:"mapping"`
}

JavaLibertyImageMappingSpec stores the java to liberty image version spec

type JavaPackageNamesMapping

type JavaPackageNamesMapping struct {
	types.TypeMeta   `yaml:",inline"`
	types.ObjectMeta `yaml:"metadata,omitempty"`
	Spec             JavaPackageNamesMappingSpec `yaml:"spec,omitempty"`
}

JavaPackageNamesMapping stores the java package version mappings

type JavaPackageNamesMappingSpec

type JavaPackageNamesMappingSpec struct {
	PackageVersions map[string]string `yaml:"packageVersions"`
}

JavaPackageNamesMappingSpec stores the java package version spec

type Jboss

type Jboss struct {
	Config      transformertypes.Transformer
	Env         *environment.Environment
	JbossConfig *JbossYamlConfig
}

Jboss implements Transformer interface

func (*Jboss) DirectoryDetect

func (t *Jboss) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*Jboss) GetConfig

GetConfig returns the transformer config

func (*Jboss) Init

Init Initializes the transformer

func (*Jboss) Transform

func (t *Jboss) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type JbossDockerfileTemplate

type JbossDockerfileTemplate struct {
	JavaPackageName    string
	DeploymentFilePath string
	BuildContainerName string
	Port               int32
	EnvVariables       map[string]string
}

JbossDockerfileTemplate stores parameters for the dockerfile template

type JbossYamlConfig

type JbossYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
}

JbossYamlConfig stores jar related configuration information

type Liberty

type Liberty struct {
	Config        transformertypes.Transformer
	Env           *environment.Environment
	LibertyConfig *LibertyYamlConfig
}

Liberty implements Transformer interface

func (*Liberty) DirectoryDetect

func (t *Liberty) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*Liberty) GetConfig

GetConfig returns the transformer config

func (*Liberty) Init

Init Initializes the transformer

func (*Liberty) Transform

func (t *Liberty) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type LibertyDockerfileTemplate

type LibertyDockerfileTemplate struct {
	JavaPackageName    string
	JavaVersion        string
	DeploymentFilePath string
	BuildContainerName string
	Port               int32
	EnvVariables       map[string]string
}

LibertyDockerfileTemplate stores parameters for the dockerfile template

type LibertyYamlConfig

type LibertyYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
}

LibertyYamlConfig stores jar related configuration information

type MavenAnalyser

type MavenAnalyser struct {
	Config      transformertypes.Transformer
	Env         *environment.Environment
	MavenConfig *MavenYamlConfig
}

MavenAnalyser implements Transformer interface

func (*MavenAnalyser) DirectoryDetect

func (t *MavenAnalyser) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*MavenAnalyser) GetConfig

GetConfig returns the transformer config

func (*MavenAnalyser) Init

Init initializes the transformer

func (*MavenAnalyser) Transform

func (t *MavenAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the input artifacts mostly handling artifacts created during the plan phase.

func (*MavenAnalyser) TransformArtifact added in v0.3.3

func (t *MavenAnalyser) TransformArtifact(newArtifact transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact, pom *maven.Pom, rootPomFilePath string, serviceConfig artifacts.ServiceConfig, mavenConfig artifacts.MavenConfig) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

TransformArtifact is the same as Transform but operating on a single artifact and its pom.xml at a time.

type MavenBuildDockerfileTemplate

type MavenBuildDockerfileTemplate struct {
	MvnwPresent        bool
	IsParentPom        bool
	JavaPackageName    string
	MavenVersion       string
	BuildContainerName string
	MavenProfiles      []string
	EnvVariables       map[string]string
}

MavenBuildDockerfileTemplate defines the information for the build dockerfile template

type MavenYamlConfig

type MavenYamlConfig struct {
	MavenVersion            string `yaml:"defaultMavenVersion"`
	JavaVersion             string `yaml:"defaultJavaVersion"`
	AppPathInBuildContainer string `yaml:"appPathInBuildContainer"`
}

MavenYamlConfig stores the maven related information

type SpringBootMetadataFiles

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

SpringBootMetadataFiles defines the lists of configuration files from spring boot applications

type Tomcat

type Tomcat struct {
	Config       transformertypes.Transformer
	Env          *environment.Environment
	TomcatConfig *TomcatYamlConfig
}

Tomcat implements Transformer interface

func (*Tomcat) DirectoryDetect

func (t *Tomcat) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*Tomcat) GetConfig

GetConfig returns the transformer config

func (*Tomcat) Init

Init Initializes the transformer

func (*Tomcat) Transform

func (t *Tomcat) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type TomcatDockerfileTemplate

type TomcatDockerfileTemplate struct {
	JavaPackageName    string
	JavaVersion        string
	DeploymentFilePath string
	BuildContainerName string
	Port               int32
	EnvVariables       map[string]string
}

TomcatDockerfileTemplate stores parameters for the dockerfile template

type TomcatYamlConfig

type TomcatYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
}

TomcatYamlConfig stores jar related configuration information

type WarAnalyser

type WarAnalyser struct {
	Config    transformertypes.Transformer
	Env       *environment.Environment
	WarConfig *WarYamlConfig
}

WarAnalyser implements Transformer interface

func (*WarAnalyser) DirectoryDetect

func (t *WarAnalyser) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)

DirectoryDetect runs detect in each sub directory

func (*WarAnalyser) GetConfig

GetConfig returns the transformer config

func (*WarAnalyser) Init

Init Initializes the transformer

func (*WarAnalyser) Transform

func (t *WarAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type WarDockerfileTemplate

type WarDockerfileTemplate struct {
	DeploymentFile                    string
	BuildContainerName                string
	DeploymentFileDirInBuildContainer string
	EnvVariables                      map[string]string
}

WarDockerfileTemplate stores parameters for the dockerfile template

type WarYamlConfig

type WarYamlConfig struct {
	JavaVersion string `yaml:"defaultJavaVersion"`
}

WarYamlConfig stores the war related information

type Zuul

type Zuul struct {
	ZuulSpec ZuulSpec `yaml:"zuul"`
}

Zuul defines zuul spring boot properties file

type ZuulAnalyser

type ZuulAnalyser struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
	// contains filtered or unexported fields
}

ZuulAnalyser implements Transformer interface

func (*ZuulAnalyser) DirectoryDetect

func (t *ZuulAnalyser) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in base directory

func (*ZuulAnalyser) GetConfig

GetConfig returns the transformer config

func (*ZuulAnalyser) Init

Init Initializes the transformer

func (*ZuulAnalyser) Transform

func (t *ZuulAnalyser) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type ZuulSpec

type ZuulSpec struct {
	RouteSpec map[string]string `yaml:"routes"`
}

ZuulSpec defines zuul specification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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