maven

package
v0.0.0-...-bcef61a Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePom

func DeletePom(directory string) error

func Marshal

func Marshal(model *Project) ([]byte, error)

func PomExists

func PomExists(directory string) (bool, error)

Types

type Activation

type Activation struct {
	ActiveByDefault bool      `xml:"activeByDefault,omitempty"`
	Jdk             string    `xml:"jdk,omitempty"`
	Os              *Os       `xml:"os,omitempty"`
	Property        *Property `xml:"property,omitempty"`
	File            *File     `xml:"file,omitempty"`
}

type Build

type Build struct {
	DefaultGoal           string            `xml:"defaultGoal,omitempty"`
	Directory             string            `xml:"directory,omitempty"`
	FinalName             string            `xml:"finalName,omitempty"`
	Filters               *StringArray      `xml:"filters,omitempty"`
	Resources             *Resources        `xml:"resources,omitempty"`
	TestResources         *Resources        `xml:"testResources,omitempty"`
	Plugins               *Plugins          `xml:"plugins,omitempty"`
	PluginManagement      *PluginManagement `xml:"pluginManagement,omitempty"`
	SourceDirectory       string            `xml:"sourceDirectory,omitempty"`
	ScriptSourceDirectory string            `xml:"scriptSourceDirectory,omitempty"`
	TestSourceDirectory   string            `xml:"testSourceDirectory,omitempty"`
	OutputDirectory       string            `xml:"outputDirectory,omitempty"`
	TestOutputDirectory   string            `xml:"testOutputDirectory,omitempty"`
	Extensions            *Extensions       `xml:"extensions,omitempty"`
}

type CiManagement

type CiManagement struct {
	System    string     `xml:"system,omitempty"`
	Url       string     `xml:"url,omitempty"`
	Notifiers *Notifiers `xml:"notifiers,omitempty"`
}

type Configuration

type Configuration []interface{}

type Contributors

type Contributors []Person

type Coordinates

type Coordinates struct {
	GroupId    string `xml:"groupId,omitempty"`
	ArtifactId string `xml:"artifactId,omitempty"`
	Version    string `xml:"version,omitempty"`
}

func NewCoordinates

func NewCoordinates(g, a, v string) Coordinates

func (*Coordinates) AssignTo

func (c *Coordinates) AssignTo(p *Project)

func (*Coordinates) CreateDependency

func (c *Coordinates) CreateDependency() *Dependency

func (*Coordinates) Equal

func (c *Coordinates) Equal(other *Coordinates) bool

func (*Coordinates) HasVersion

func (c *Coordinates) HasVersion() bool

func (*Coordinates) RemoveVersion

func (c *Coordinates) RemoveVersion()

func (*Coordinates) Similar

func (c *Coordinates) Similar(other *Coordinates) bool

type Dependencies

type Dependencies struct {
	Values []Dependency `xml:"dependency,omitempty"`
}

func NewDependencies

func NewDependencies() *Dependencies

func (*Dependencies) AddDependencies

func (d *Dependencies) AddDependencies(deps []*Dependency)

func (*Dependencies) AddDependency

func (d *Dependencies) AddDependency(dependency *Dependency)

func (*Dependencies) GetDependency

func (d *Dependencies) GetDependency(c *Coordinates) *Dependency

func (*Dependencies) HasDependency

func (d *Dependencies) HasDependency(c *Coordinates) bool

func (*Dependencies) RemoveDependency

func (d *Dependencies) RemoveDependency(c *Coordinates) *Dependency

type Dependency

type Dependency struct {
	GroupId    string `xml:"groupId,omitempty"`
	ArtifactId string `xml:"artifactId,omitempty"`
	Version    string `xml:"version,omitempty"`
	Type       string `xml:"type,omitempty"`
	Scope      string `xml:"scope,omitempty"`
	Optional   bool   `xml:"optional,omitempty"`
}

func (*Dependency) GetCoordinates

func (d *Dependency) GetCoordinates() *Coordinates

func (Dependency) IsSimilar

func (d Dependency) IsSimilar(other Dependency) bool

type DependencyManagement

type DependencyManagement struct {
	Dependencies *Dependencies `xml:"dependencies,omitempty"`
}

func NewDependencyManagement

func NewDependencyManagement() *DependencyManagement

type Developers

type Developers []Person

type DistributionManagement

type DistributionManagement struct {
	Repository         *DistributionRepository `xml:"repository,omitempty"`
	SnapshotRepository *DistributionRepository `xml:"snapshotRepository,omitempty"`
	Site               *Site                   `xml:"site,omitempty"`
	Relocation         *Relocation             `xml:"relocation,omitempty"`
	DownloadUrl        string                  `xml:"downloadUrl,omitempty"`
	Status             string                  `xml:"status,omitempty"`
}

type DistributionRepository

type DistributionRepository struct {
	UniqueVersion bool   `xml:"uniqueVersion,omitempty"`
	Id            string `xml:"id,omitempty"`
	Name          string `xml:"name,omitempty"`
	Url           string `xml:"url,omitempty"`
	Layout        string `xml:"layout,omitempty"`
}

type Execution

type Execution struct {
	Id            string         `xml:"id,omitempty"`
	Goals         *StringArray   `xml:"goals,omitempty"`
	Phase         string         `xml:"phase,omitempty"`
	Inherited     bool           `xml:"inherited,omitempty"`
	Configuration *Configuration `xml:"configuration,omitempty"`
}

type Executions

type Executions []Execution

type Extension

type Extension struct {
	GroupId    string `xml:"groupId,omitempty"`
	ArtifactId string `xml:"artifactId,omitempty"`
	Version    string `xml:"version,omitempty"`
}

type Extensions

type Extensions []Extension

type File

type File struct {
	Exists  string `xml:"exists,omitempty"`
	Missing string `xml:"missing,omitempty"`
}

type IssueManagement

type IssueManagement struct {
	System string `xml:"system,omitempty"`
	Url    string `xml:"url,omitempty"`
}

type License

type License struct {
	Name         string `xml:"name,omitempty"`
	Url          string `xml:"url,omitempty"`
	Distribution string `xml:"distribution,omitempty"`
	Comments     string `xml:"comments,omitempty"`
}

type Licenses

type Licenses []License

type MailingList

type MailingList struct {
	Name          string       `xml:"name,omitempty"`
	Subscribe     string       `xml:"subscribe,omitempty"`
	Unsubscribe   string       `xml:"unsubscribe,omitempty"`
	Post          string       `xml:"post,omitempty"`
	Archive       string       `xml:"archive,omitempty"`
	OtherArchives *StringArray `xml:"otherArchives,omitempty"`
}

type MailingLists

type MailingLists []MailingList

type ModelReadWriter

type ModelReadWriter interface {
	ModelReader
	ModelWriter
}

type ModelReader

type ModelReader interface {
	GetParent() *Parent
	HasParent() bool
	GetCoordinates() *Coordinates
	GetDependency(c *Coordinates) *Dependency
	HasDependency(c *Coordinates) bool
	GetManagedDependency(c *Coordinates) *Dependency
	HasManagedDependency(c *Coordinates) bool
	GetProperties() *map[string]string
	GetProperty() string
	HasProperty(k string) bool
}

type ModelWriter

type ModelWriter interface {
	SetParent(p *Parent)
	RemoveParent() *Parent
	SetCoordinates(c *Coordinates)
	AddDependency(d *Dependency)
	RemoveDependency(c *Coordinates) *Dependency
	AddManagedDependency(d *Dependency)
	AddManagedDependencies(d []*Dependency)
	RemoveManagedDependency(c *Coordinates) *Dependency
	AddProperty(k, v string)
	AddProperties(p map[string]string)
}

type ModuleArray

type ModuleArray struct {
	Values []string `xml:"module,omitempty"`
}

type Notifier

type Notifier struct {
	Type          string         `xml:"type,omitempty"`
	SendOnError   string         `xml:"sendOnError,omitempty"`
	SendOnFailure string         `xml:"sendOnFailure,omitempty"`
	SendOnSuccess string         `xml:"sendOnSuccess,omitempty"`
	SendOnWarning string         `xml:"sendOnWarning,omitempty"`
	Configuration *Configuration `xml:"configuration,omitempty"`
}

type Notifiers

type Notifiers []Notifier

type Organization

type Organization struct {
	Name string `xml:"name,omitempty"`
	Url  string `xml:"url,omitempty"`
}

type Os

type Os struct {
	Name    string `xml:"name,omitempty"`
	Family  string `xml:"family,omitempty"`
	Arch    string `xml:"arch,omitempty"`
	Version string `xml:"version,omitempty"`
}

type Parent

type Parent struct {
	GroupId      string `xml:"groupId,omitempty"`
	ArtifactId   string `xml:"artifactId,omitempty"`
	Version      string `xml:"version,omitempty"`
	RelativePath string `xml:"relativePath,omitempty"`
}

type Person

type Person struct {
	Id              string       `xml:"id,omitempty"`
	Name            string       `xml:"name,omitempty"`
	Email           string       `xml:"email,omitempty"`
	Url             string       `xml:"url,omitempty"`
	Organization    string       `xml:"organization,omitempty"`
	OrganizationUrl string       `xml:"organizationUrl,omitempty"`
	Roles           *StringArray `xml:"roles,omitempty"`
	Timezone        string       `xml:"timezone,omitempty"`
	Properties      *Properties  `xml:"properties,omitempty"`
}

type Plugin

type Plugin struct {
	GroupId       string        `xml:"groupId,omitempty"`
	ArtifactId    string        `xml:"artifactId,omitempty"`
	Version       string        `xml:"version,omitempty"`
	Extensions    bool          `xml:"extensions,omitempty"`
	Inherited     bool          `xml:"inherited,omitempty"`
	Configuration *Properties   `xml:"configuration,omitempty"`
	Dependencies  *Dependencies `xml:"dependencies,omitempty"`
	Executions    *Executions   `xml:"executions,omitempty"`
}

type PluginManagement

type PluginManagement []Plugin

type Plugins

type Plugins []Plugin

type Pom

type Pom interface {
	Store() error
	Load() error
	GetPath() string
	GetDirectory() string

	ModelReadWriter
}

func CreatePom

func CreatePom(directory string) (Pom, error)

func LoadPom

func LoadPom(directory string) (Pom, error)

LoadPom loads a pom.xml file from directory and returns a Pom structure If pom.xml does not exist, LoadPom returns an error

func SearchPom

func SearchPom(path string) (Pom, error)

type Prerequisites

type Prerequisites struct {
	Maven string `xml:"maven,omitempty"`
}

type Profile

type Profile struct {
	Id                     string                  `xml:"id,omitempty"`
	Activation             *Activation             `xml:"activation,omitempty"`
	Build                  *Build                  `xml:"build,omitempty"`
	Modules                *StringArray            `xml:"modules,omitempty"`
	Repositories           *Repositories           `xml:"repositories,omitempty"`
	PluginRepositories     *Repositories           `xml:"pluginRepositories,omitempty"`
	Dependencies           *Dependencies           `xml:"dependencies,omitempty"`
	Reporting              *Reporting              `xml:"reporting,omitempty"`
	DependencyManagement   *DependencyManagement   `xml:"dependencyManagement,omitempty"`
	DistributionManagement *DistributionManagement `xml:"distributionManagement,omitempty"`
}

type Profiles

type Profiles []Profile

type Project

type Project struct {
	XMLName                xml.Name                `xml:"project"`
	ModelVersion           string                  `xml:"modelVersion,omitempty"`
	Parent                 *Parent                 `xml:"parent,omitempty"`
	GroupId                string                  `xml:"groupId,omitempty"`
	ArtifactId             string                  `xml:"artifactId,omitempty"`
	Version                string                  `xml:"version,omitempty"`
	Packaging              string                  `xml:"packaging,omitempty"`
	Properties             *Properties             `xml:"properties,omitempty"`
	Dependencies           *Dependencies           `xml:"dependencies,omitempty"`
	DependencyManagement   *DependencyManagement   `xml:"dependencyManagement,omitempty"`
	Modules                *ModuleArray            `xml:"modules,omitempty"`
	Build                  *Build                  `xml:"build,omitempty"`
	Reporting              *Reporting              `xml:"reporting,omitempty"`
	Name                   string                  `xml:"name,omitempty"`
	Description            string                  `xml:"description,omitempty"`
	Url                    string                  `xml:"url,omitempty"`
	InceptionYear          string                  `xml:"inceptionYear,omitempty"`
	Licenses               *Licenses               `xml:"licenses>license,omitempty"`
	Organization           *Organization           `xml:"organization,omitempty"`
	Developers             *Developers             `xml:"developers>developer,omitempty"`
	Contributors           *Contributors           `xml:"contributors>contributor,omitempty"`
	IssueManagement        *IssueManagement        `xml:"issueManagement,omitempty"`
	CiManagement           *CiManagement           `xml:"ciManagement,omitempty"`
	MailingLists           *MailingLists           `xml:"mailingLists>mailingList,omitempty"`
	Scm                    *Scm                    `xml:"scm,omitempty"`
	Prerequisites          *Prerequisites          `xml:"prerequisites,omitempty"`
	Repositories           *Repositories           `xml:"repositories>repository,omitempty"`
	PluginRepositories     *Repositories           `xml:"pluginRepositories>repository,omitempty"`
	DistributionManagement *DistributionManagement `xml:"distributionManagement,omitempty"`
	Profiles               *Profiles               `xml:"profiles>profile,omitempty"`
}

func NewProject

func NewProject() *Project

func Unmarshal

func Unmarshal(data []byte) (*Project, error)

func (*Project) AddDependencies

func (p *Project) AddDependencies(d []*Dependency)

func (*Project) AddDependency

func (p *Project) AddDependency(d *Dependency)

func (*Project) AddManagedDependencies

func (p *Project) AddManagedDependencies(d []*Dependency)

func (*Project) AddManagedDependency

func (p *Project) AddManagedDependency(d *Dependency)

func (*Project) AddModules

func (p *Project) AddModules(modules []string)

func (*Project) AddProperties

func (p *Project) AddProperties(props map[string]string)

func (*Project) AddProperty

func (p *Project) AddProperty(k, v string)

func (*Project) GetCoordinates

func (p *Project) GetCoordinates() *Coordinates

func (*Project) GetDependency

func (p *Project) GetDependency(c *Coordinates) *Dependency

func (*Project) GetManagedDependency

func (p *Project) GetManagedDependency(c *Coordinates) *Dependency

func (*Project) HasDependency

func (p *Project) HasDependency(c *Coordinates) bool

func (*Project) HasManagedDependency

func (p *Project) HasManagedDependency(c *Coordinates) bool

func (*Project) HasProperty

func (p *Project) HasProperty(k string) bool

func (*Project) RemoveDependency

func (p *Project) RemoveDependency(c *Coordinates) *Dependency

func (*Project) RemoveManagedDependency

func (p *Project) RemoveManagedDependency(c *Coordinates) *Dependency

func (*Project) RemoveParent

func (p *Project) RemoveParent() *Parent

func (*Project) SetCoordinates

func (p *Project) SetCoordinates(c *Coordinates)

func (*Project) SetParent

func (p *Project) SetParent(parent *Parent)

type Properties

type Properties struct {
	Entries map[string]string
}

func NewProperties

func NewProperties() *Properties

func (*Properties) AddProperties

func (p *Properties) AddProperties(props map[string]string)

func (*Properties) AddProperty

func (p *Properties) AddProperty(k, v string)

func (*Properties) HasProperty

func (p *Properties) HasProperty(k string) bool

func (*Properties) MarshalXML

func (p *Properties) MarshalXML(d *xml.Encoder, start xml.StartElement) (err error)

func (*Properties) UnmarshalXML

func (p *Properties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type Property

type Property struct {
	Name  string `xml:"name,omitempty"`
	Value string `xml:"value,omitempty"`
}

type Relocation

type Relocation struct {
	GroupId    string `xml:"groupId,omitempty"`
	ArtifactId string `xml:"artifactId,omitempty"`
	Version    string `xml:"version,omitempty"`
	Message    string `xml:"message,omitempty"`
}

type Reporting

type Reporting struct {
	OutputDirectory string   `xml:"outputDirectory,omitempty"`
	Plugins         *Plugins `xml:"plugins,omitempty"`
}

type Repositories

type Repositories []Repository

type Repository

type Repository struct {
	Releases  *RepositoryPolicies `xml:"releases,omitempty"`
	Snapshots *RepositoryPolicies `xml:"snapshots,omitempty"`
	Name      string              `xml:"name,omitempty"`
	Id        string              `xml:"id,omitempty"`
	Url       string              `xml:"url,omitempty"`
	Layout    string              `xml:"layout,omitempty"`
}

type RepositoryPolicies

type RepositoryPolicies struct {
	Enabled        bool   `xml:"enabled,omitempty"`
	UpdatePolicy   string `xml:"updatePolicy,omitempty"`
	ChecksumPolicy string `xml:"checksumPolicy,omitempty"`
}

type Resource

type Resource struct {
	TargetPath string       `xml:"targetPath,omitempty"`
	Filtering  bool         `xml:"filtering,omitempty"`
	Directory  string       `xml:"directory,omitempty"`
	Includes   *StringArray `xml:"includes,omitempty"`
	Excludes   *StringArray `xml:"excludes,omitempty"`
}

type Resources

type Resources []Resource

type Scm

type Scm struct {
	Connection          string `xml:"connection,omitempty"`
	DeveloperConnection string `xml:"developerConnection,omitempty"`
	Tag                 string `xml:"tag,omitempty"`
	Url                 string `xml:"url,omitempty"`
}

type Site

type Site struct {
	Id   string `xml:"id,omitempty"`
	Name string `xml:"name,omitempty"`
	Url  string `xml:"url,omitempty"`
}

type StringArray

type StringArray struct {
	Values []string
}

Jump to

Keyboard shortcuts

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