Documentation ¶
Index ¶
- Constants
- Variables
- func NewRepository(repo string) v1.Repository
- func SettingsConfigMap(namespace string, name string, settings Settings) (*corev1.ConfigMap, error)
- type Activation
- type Build
- type Command
- type Context
- type Dependency
- type DependencyManagement
- type Exclusion
- type Execution
- type Mirror
- 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) Command(context Context) *Command
- func (p *Project) LookupDependency(dep Dependency) *Dependency
- func (p Project) MarshalBytes() ([]byte, error)
- func (p *Project) ReplaceDependency(dep Dependency)
- type Properties
- type PropertyActivation
- type Settings
Constants ¶
const ( TRACE = "TRACE" DEBUG = "DEBUG" INFO = "INFO" WARN = "WARN" ERROR = "ERROR" FATAL = "FATAL" )
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")
Functions ¶
func NewRepository ¶
func NewRepository(repo string) v1.Repository
NewRepository parses the given repository URL and generates the corresponding v1.Repository.
The repository can be customized by appending @param to the repository URL, e.g.:
http://my-nexus:8081/repository/publicc@id=my-repo@snapshots
That enables snapshots and sets the repository id to `my-repo`
Types ¶
type Activation ¶
type Activation struct { ActiveByDefault bool `xml:"activeByDefault"` Property *PropertyActivation `xml:"property,omitempty"` }
type Build ¶
type Build struct { DefaultGoal string `xml:"defaultGoal,omitempty"` Plugins []Plugin `xml:"plugins>plugin,omitempty"` Extensions []v1.MavenArtifact `xml:"extensions>extension,omitempty"` }
type Context ¶
type Context struct { Path string // Project Project ExtraMavenOpts []string SettingsContent []byte AdditionalArguments []string AdditionalEntries map[string]interface{} // Timeout time.Duration LocalRepository string }
func NewContext ¶
func (*Context) AddArgument ¶
func (*Context) AddArgumentf ¶
func (*Context) AddArguments ¶
func (*Context) 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 models a dependency
func NewDependency ¶
func NewDependency(groupID string, artifactID string, version string) Dependency
NewDependency creates an new dependency from the given GAV
func ParseGAV ¶
func ParseGAV(gav string) (Dependency, error)
ParseGAV decodes the provided Maven GAV into the corresponding Dependency.
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 models dependency management
type Exclusion ¶
type Exclusion struct { GroupID string `xml:"groupId" yaml:"groupId"` ArtifactID string `xml:"artifactId" yaml:"artifactId"` }
Exclusion models a dependency exclusion
type Mirror ¶ added in v1.4.0
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"` }
type Profile ¶
type Profile struct { ID string `xml:"id"` Activation Activation `xml:"activation,omitempty"` Properties Properties `xml:"properties,omitempty"` Repositories []v1.Repository `xml:"repositories>repository,omitempty"` PluginRepositories []v1.Repository `xml:"pluginRepositories>pluginRepository,omitempty"` }
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 []v1.Repository `xml:"repositories>repository,omitempty"` PluginRepositories []v1.Repository `xml:"pluginRepositories>pluginRepository,omitempty"` Build *Build `xml:"build,omitempty"` }
Project models a Maven project
func NewProject ¶
func NewProject() Project
func 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)
func (*Project) AddDependencyExclusions ¶
func (p *Project) AddDependencyExclusions(dep Dependency, exclusions ...Exclusion)
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
func (Project) MarshalBytes ¶
func (*Project) ReplaceDependency ¶
func (p *Project) ReplaceDependency(dep Dependency)
type Properties ¶
func (Properties) AddAll ¶
func (m Properties) AddAll(properties map[string]string)
func (Properties) MarshalXML ¶
func (m Properties) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type PropertyActivation ¶
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"` Mirrors []Mirror `xml:"mirrors>mirror,omitempty"` }
Settings models a Maven settings
func NewDefaultSettings ¶
func NewDefaultSettings(repositories []v1.Repository, mirrors []Mirror) Settings
func NewSettings ¶
func NewSettings() Settings