Documentation ¶
Index ¶
- Variables
- func CreateSettingsConfigMap(namespace string, name string, settings Settings) (*corev1.ConfigMap, error)
- func GenerateProjectStructure(context Context) error
- func Run(ctx Context) error
- type Activation
- type Build
- type Context
- type Dependency
- type DependencyManagement
- type Exclusion
- type Execution
- type Plugin
- type Profile
- type Project
- func (p *Project) AddDependencies(deps ...Dependency)
- func (p *Project) AddDependency(dep Dependency)
- func (p *Project) AddDependencyExclusion(dep Dependency, exclusion Exclusion)
- func (p *Project) AddDependencyExclusions(dep Dependency, exclusions ...Exclusion)
- func (p *Project) AddDependencyGAV(groupID string, artifactID string, version string)
- func (p *Project) AddEncodedDependencyGAV(gav string)
- func (p *Project) LookupDependency(dep Dependency) *Dependency
- func (p Project) MarshalBytes() ([]byte, error)
- func (p *Project) ReplaceDependency(dep Dependency)
- type Properties
- type PropertyActivation
- type Repository
- type RepositoryPolicy
- type Settings
Constants ¶
This section is empty.
Variables ¶
var DefaultMavenRepositories = "https://repo.maven.apache.org/maven2@id=central"
DefaultMavenRepositories is a comma separated list of default maven repositories This variable can be overridden at build time
var Log = log.WithName("maven")
Log --
Functions ¶
func CreateSettingsConfigMap ¶
func CreateSettingsConfigMap(namespace string, name string, settings Settings) (*corev1.ConfigMap, error)
CreateSettingsConfigMap --
func GenerateProjectStructure ¶
GenerateProjectStructure --
Types ¶
type Activation ¶
type Activation struct { ActiveByDefault bool `xml:"activeByDefault"` Property *PropertyActivation `xml:"property,omitempty"` }
Activation --
type Build ¶
type Build struct { DefaultGoal string `xml:"defaultGoal,omitempty"` Plugins []Plugin `xml:"plugins>plugin,omitempty"` }
Build --
type Context ¶
type Context struct { Path string Project Project SettingsContent []byte AdditionalArguments []string AdditionalEntries map[string]interface{} Timeout time.Duration LocalRepository string Stdout io.Writer }
Context --
func (*Context) AddArgumentf ¶
AddArgumentf --
func (*Context) AddSystemProperty ¶
AddSystemProperty --
type Dependency ¶
type Dependency struct { GroupID string `xml:"groupId" yaml:"groupId"` ArtifactID string `xml:"artifactId" yaml:"artifactId"` Version string `xml:"version,omitempty" yaml:"version,omitempty"` Type string `xml:"type,omitempty" yaml:"type,omitempty"` Classifier string `xml:"classifier,omitempty" yaml:"classifier,omitempty"` Scope string `xml:"scope,omitempty" yaml:"scope,omitempty"` Exclusions *[]Exclusion `xml:"exclusions>exclusion,omitempty" yaml:"exclusions,omitempty"` }
Dependency represent a maven's dependency
func NewDependency ¶
func NewDependency(groupID string, artifactID string, version string) Dependency
NewDependency create an new dependency from the given gav info
func ParseGAV ¶
func ParseGAV(gav string) (Dependency, error)
ParseGAV decode a maven artifact id to a dependency definition.
The artifact id is in the form of:
<groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')
type DependencyManagement ¶
type DependencyManagement struct {
Dependencies []Dependency `xml:"dependencies>dependency,omitempty"`
}
DependencyManagement represent maven's dependency management block
type Exclusion ¶
type Exclusion struct { GroupID string `xml:"groupId" yaml:"groupId"` ArtifactID string `xml:"artifactId" yaml:"artifactId"` }
Exclusion represent a maven's dependency exlucsion
type Execution ¶
type Execution struct { ID string `xml:"id,omitempty"` Phase string `xml:"phase,omitempty"` Goals []string `xml:"goals>goal,omitempty"` }
Execution --
type Plugin ¶
type Plugin struct { GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` Version string `xml:"version,omitempty"` Executions []Execution `xml:"executions>execution,omitempty"` Dependencies []Dependency `xml:"dependencies>dependency,omitempty"` }
Plugin --
type Profile ¶
type Profile struct { ID string `xml:"id"` Activation Activation `xml:"activation,omitempty"` Properties Properties `xml:"properties,omitempty"` Repositories []Repository `xml:"repositories>repository,omitempty"` PluginRepositories []Repository `xml:"pluginRepositories>pluginRepository,omitempty"` }
Profile --
type Project ¶
type Project struct { XMLName xml.Name XMLNs string `xml:"xmlns,attr"` XMLNsXsi string `xml:"xmlns:xsi,attr"` XsiSchemaLocation string `xml:"xsi:schemaLocation,attr"` ModelVersion string `xml:"modelVersion"` GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` Version string `xml:"version"` Properties Properties `xml:"properties,omitempty"` DependencyManagement *DependencyManagement `xml:"dependencyManagement"` Dependencies []Dependency `xml:"dependencies>dependency,omitempty"` Repositories []Repository `xml:"repositories>repository,omitempty"` PluginRepositories []Repository `xml:"pluginRepositories>pluginRepository,omitempty"` Build *Build `xml:"build,omitempty"` }
Project represent a maven project
func NewProjectWithGAV ¶
NewProjectWithGAV --
func (*Project) AddDependencies ¶
func (p *Project) AddDependencies(deps ...Dependency)
AddDependencies adds dependencies to maven's dependencies
func (*Project) AddDependency ¶
func (p *Project) AddDependency(dep Dependency)
AddDependency adds a dependency to maven's dependencies
func (*Project) AddDependencyExclusion ¶
func (p *Project) AddDependencyExclusion(dep Dependency, exclusion Exclusion)
AddDependencyExclusion --
func (*Project) AddDependencyExclusions ¶
func (p *Project) AddDependencyExclusions(dep Dependency, exclusions ...Exclusion)
AddDependencyExclusions --
func (*Project) AddDependencyGAV ¶
AddDependencyGAV a dependency to maven's dependencies
func (*Project) AddEncodedDependencyGAV ¶
AddEncodedDependencyGAV a dependency to maven's dependencies
func (*Project) LookupDependency ¶
func (p *Project) LookupDependency(dep Dependency) *Dependency
LookupDependency --
func (*Project) ReplaceDependency ¶
func (p *Project) ReplaceDependency(dep Dependency)
ReplaceDependency --
type Properties ¶
Properties --
func (Properties) MarshalXML ¶
func (m Properties) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML --
type PropertyActivation ¶
PropertyActivation --
type Repository ¶
type Repository struct { ID string `xml:"id"` Name string `xml:"name,omitempty"` URL string `xml:"url"` Snapshots RepositoryPolicy `xml:"snapshots,omitempty"` Releases RepositoryPolicy `xml:"releases,omitempty"` }
Repository --
func NewRepository ¶
func NewRepository(repo string) Repository
NewRepository parse the given repo url ang generated the related struct.
The repository can be customized by appending @instruction to the repository uri, as example:
http://my-nexus:8081/repository/publicc@id=my-repo@snapshots
Will enable snapshots and sets the repo it to my-repo
type RepositoryPolicy ¶
type RepositoryPolicy struct { Enabled bool `xml:"enabled"` UpdatePolicy string `xml:"updatePolicy,omitempty"` ChecksumPolicy string `xml:"checksumPolicy,omitempty"` }
RepositoryPolicy --
type Settings ¶
type Settings struct { XMLName xml.Name XMLNs string `xml:"xmlns,attr"` XMLNsXsi string `xml:"xmlns:xsi,attr"` XsiSchemaLocation string `xml:"xsi:schemaLocation,attr"` LocalRepository string `xml:"localRepository"` Profiles []Profile `xml:"profiles>profile,omitempty"` }
Settings represent a maven settings
func NewDefaultSettings ¶
func NewDefaultSettings(repositories []Repository) Settings
NewDefaultSettings --