pom

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFirstTwoPartsOfGroupId

func GetFirstTwoPartsOfGroupId(groupId string) (string, error)

func Marshall

func Marshall(project *Model, indent string) ([]byte, error)

func SetDependencyVersionElement

func SetDependencyVersionElement(dependencies *Dependencies, dep Dependency, newVersion string) bool

Types

type Activation

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

type ActivationFile

type ActivationFile struct {
	Comment string `xml:",comment"`
	Missing string `xml:"missing,omitempty"`
	Exists  string `xml:"exists,omitempty"`
}

type ActivationOS

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

type ActivationProperty

type ActivationProperty struct {
	Comment string `xml:",comment"`
	Name    string `xml:"name,omitempty"`
	Value   string `xml:"value,omitempty"`
}

type Any

type Any struct {
	XMLName     xml.Name
	Attrs       []xml.Attr `xml:",any,attr"`
	Value       string     `xml:",chardata"`
	AnyElements []Any      `xml:",any"`
}

func (*Any) AddKey

func (any *Any) AddKey(key string, value string) error

func (Any) FindKey

func (any Any) FindKey(key string) (string, error)

func (*Any) SetKey

func (any *Any) SetKey(key string, value string) error

type Build

type Build struct {
	Comment               string            `xml:",comment"`
	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"`
	DefaultGoal           string            `xml:"defaultGoal,omitempty"`
	Resources             *Resources        `xml:"resources,omitempty"`
	TestResources         *TestResources    `xml:"testResources,omitempty"`
	Directory             string            `xml:"directory,omitempty"`
	FinalName             string            `xml:"finalName,omitempty"`
	Filters               *Filters          `xml:"filters,omitempty"`
	PluginManagement      *PluginManagement `xml:"pluginManagement,omitempty"`
	Plugins               *BuildPlugins     `xml:"plugins,omitempty"`
}

type BuildBase

type BuildBase struct {
	Comment          string            `xml:",comment"`
	DefaultGoal      string            `xml:"defaultGoal,omitempty"`
	Resources        *Resources        `xml:"resources,omitempty"`
	TestResources    *TestResources    `xml:"testResources,omitempty"`
	Directory        string            `xml:"directory,omitempty"`
	FinalName        string            `xml:"finalName,omitempty"`
	Filters          *Filters          `xml:"filters,omitempty"`
	PluginManagement *PluginManagement `xml:"pluginManagement,omitempty"`
	Plugins          *BuildBasePlugins `xml:"plugins,omitempty"`
}

type BuildBasePlugins

type BuildBasePlugins struct {
	Plugin  []Plugin `xml:"plugin,omitempty"`
	Comment string   `xml:",comment"`
}

type BuildPlugins

type BuildPlugins struct {
	Plugin  []Plugin `xml:"plugin,omitempty"`
	Comment string   `xml:",comment"`
}

type CiManagement

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

type Contributor

type Contributor struct {
	Comment         string `xml:",comment"`
	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           *Roles `xml:"roles,omitempty"`
	Timezone        string `xml:"timezone,omitempty"`
	Properties      *Any   `xml:"properties,omitempty"`
}

type Contributors

type Contributors struct {
	Comment     string        `xml:",comment"`
	Contributor []Contributor `xml:"contributor,omitempty"`
}

type Dependencies

type Dependencies struct {
	Dependency []Dependency `xml:"dependency,omitempty"`
	Comment    string       `xml:",comment"`
}

func (Dependencies) FindArtifact

func (deps Dependencies) FindArtifact(artifactId string) (Dependency, error)

func (Dependencies) FindDuplicates

func (deps Dependencies) FindDuplicates() (duplicates []Dependency)

type Dependency

type Dependency struct {
	Comment    string      `xml:",comment"`
	GroupId    string      `xml:"groupId,omitempty"`
	ArtifactId string      `xml:"artifactId,omitempty"`
	Version    string      `xml:"version,omitempty"`
	Type_      string      `xml:"type,omitempty"`
	Classifier string      `xml:"classifier,omitempty"`
	Scope      string      `xml:"scope,omitempty"`
	SystemPath string      `xml:"systemPath,omitempty"`
	Exclusions *Exclusions `xml:"exclusions,omitempty"`
	Optional   string      `xml:"optional,omitempty"`
}

type DependencyManagement

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

type DeploymentRepository

type DeploymentRepository struct {
	Comment       string            `xml:",comment"`
	UniqueVersion bool              `xml:"uniqueVersion,omitempty"`
	Releases      *RepositoryPolicy `xml:"releases,omitempty"`
	Snapshots     *RepositoryPolicy `xml:"snapshots,omitempty"`
	Id            string            `xml:"id,omitempty"`
	Name          string            `xml:"name,omitempty"`
	Url           string            `xml:"url,omitempty"`
	Layout        string            `xml:"layout,omitempty"`
}

type Developer

type Developer struct {
	Comment         string `xml:",comment"`
	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           *Roles `xml:"roles,omitempty"`
	Timezone        string `xml:"timezone,omitempty"`
	Properties      *Any   `xml:"properties,omitempty"`
}

type Developers

type Developers struct {
	Comment   string      `xml:",comment"`
	Developer []Developer `xml:"developer,omitempty"`
}

type DistributionManagement

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

type Excludes

type Excludes struct {
	Comment string   `xml:",comment"`
	Exclude []string `xml:"exclude,omitempty"`
}

type Exclusion

type Exclusion struct {
	Comment    string `xml:",comment"`
	GroupId    string `xml:"groupId,omitempty"`
	ArtifactId string `xml:"artifactId,omitempty"`
}

type Exclusions

type Exclusions struct {
	Comment   string      `xml:",comment"`
	Exclusion []Exclusion `xml:"exclusion,omitempty"`
}

type Executions

type Executions struct {
	Comment   string            `xml:",comment"`
	Execution []PluginExecution `xml:"execution,omitempty"`
}

type Extension

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

type Extensions

type Extensions struct {
	Comment   string      `xml:",comment"`
	Extension []Extension `xml:"extension,omitempty"`
}

type Filters

type Filters struct {
	Filter  []string `xml:"filter,omitempty"`
	Comment string   `xml:",comment"`
}

type Goals

type Goals struct {
	Comment string   `xml:",comment"`
	Goal    []string `xml:"goal,omitempty"`
}

type Includes

type Includes struct {
	Comment string   `xml:",comment"`
	Include []string `xml:"include,omitempty"`
}

type IssueManagement

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

type License

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

type Licenses

type Licenses struct {
	Comment string    `xml:",comment"`
	License []License `xml:"license,omitempty"`
}

type MailingList

type MailingList struct {
	Comment       string         `xml:",comment"`
	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 *OtherArchives `xml:"otherArchives,omitempty"`
}

type MailingLists

type MailingLists struct {
	Comment     string        `xml:",comment"`
	MailingList []MailingList `xml:"mailingList,omitempty"`
}

type Model

type Model struct {
	Comment                string                  `xml:",comment"`
	XMLName                xml.Name                `xml:"project"`
	Xmlns                  string                  `xml:"xmlns,attr"`
	SchemaLocation         string                  `xml:"xsi,attr"`
	Xsi                    string                  `xml:"schemaLocation,attr"`
	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"`
	Name                   string                  `xml:"name,omitempty"`
	Description            string                  `xml:"description,omitempty"`
	Url                    string                  `xml:"url,omitempty"`
	InceptionYear          string                  `xml:"inceptionYear,omitempty"`
	Organization           *Organization           `xml:"organization,omitempty"`
	Licenses               *Licenses               `xml:"licenses,omitempty"`
	Developers             *Developers             `xml:"developers,omitempty"`
	Contributors           *Contributors           `xml:"contributors,omitempty"`
	MailingLists           *MailingLists           `xml:"mailingLists,omitempty"`
	Prerequisites          *Prerequisites          `xml:"prerequisites,omitempty"`
	Modules                *Modules                `xml:"modules,omitempty"`
	Scm                    *Scm                    `xml:"scm,omitempty"`
	IssueManagement        *IssueManagement        `xml:"issueManagement,omitempty"`
	CiManagement           *CiManagement           `xml:"ciManagement,omitempty"`
	DistributionManagement *DistributionManagement `xml:"distributionManagement,omitempty"`
	Properties             *Any                    `xml:"properties,omitempty"`
	DependencyManagement   *DependencyManagement   `xml:"dependencyManagement,omitempty"`
	Dependencies           *Dependencies           `xml:"dependencies,omitempty"`
	Repositories           *Repositories           `xml:"repositories,omitempty"`
	PluginRepositories     *PluginRepositories     `xml:"pluginRepositories,omitempty"`
	Build                  *Build                  `xml:"build,omitempty"`
	Reports                *Any                    `xml:"reports,omitempty"`
	Reporting              *Reporting              `xml:"reporting,omitempty"`
	Profiles               *Profiles               `xml:"profiles,omitempty"`
}

func GetModelFrom

func GetModelFrom(path string) (*Model, error)

func (*Model) FindDependency

func (model *Model) FindDependency(groupId string, artifactId string) (Dependency, error)

func (*Model) GetDependencyVersion

func (model *Model) GetDependencyVersion(dep Dependency) (string, error)

func (*Model) GetGroupId

func (model *Model) GetGroupId() (groupId string)

func (*Model) GetPluginVersion

func (model *Model) GetPluginVersion(plugin Plugin) (string, error)

func (*Model) GetSecondPartyGroupId

func (model *Model) GetSecondPartyGroupId() (string, error)

func (*Model) InsertDependency

func (model *Model) InsertDependency(dep Dependency)

func (*Model) RemoveDependency

func (model *Model) RemoveDependency(dep Dependency) error

func (*Model) ReplaceVersionTagForDependency

func (model *Model) ReplaceVersionTagForDependency(dep Dependency) error

func (*Model) ReplaceVersionTagForDependencyManagement

func (model *Model) ReplaceVersionTagForDependencyManagement(dep Dependency) error

func (*Model) SetDependencyVersion

func (model *Model) SetDependencyVersion(dep Dependency, newVersion string) error

func (*Model) SetPluginVersion

func (model *Model) SetPluginVersion(plugin Plugin, newVersion string) error

func (*Model) WriteToFile

func (model *Model) WriteToFile(outputFile string, indent string) error

type Modules

type Modules struct {
	Module  []string `xml:"module,omitempty"`
	Comment string   `xml:",comment"`
}

type Notifier

type Notifier struct {
	Comment       string `xml:",comment"`
	Type_         string `xml:"type,omitempty"`
	SendOnError   bool   `xml:"sendOnError,omitempty"`
	SendOnFailure bool   `xml:"sendOnFailure,omitempty"`
	SendOnSuccess bool   `xml:"sendOnSuccess,omitempty"`
	SendOnWarning bool   `xml:"sendOnWarning,omitempty"`
	Address       string `xml:"address,omitempty"`
	Configuration *Any   `xml:"configuration,omitempty"`
}

type Notifiers

type Notifiers struct {
	Comment  string     `xml:",comment"`
	Notifier []Notifier `xml:"notifier,omitempty"`
}

type Organization

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

type OtherArchives

type OtherArchives struct {
	Comment      string   `xml:",comment"`
	OtherArchive []string `xml:"otherArchive,omitempty"`
}

type Parent

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

type Plugin

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

type PluginExecution

type PluginExecution struct {
	Comment       string `xml:",comment"`
	Id            string `xml:"id,omitempty"`
	Phase         string `xml:"phase,omitempty"`
	Goals         *Goals `xml:"goals,omitempty"`
	Inherited     string `xml:"inherited,omitempty"`
	Configuration *Any   `xml:"configuration,omitempty"`
}

type PluginManagement

type PluginManagement struct {
	Comment string                   `xml:",comment"`
	Plugins *PluginManagementPlugins `xml:"plugins,omitempty"`
}

type PluginManagementPlugins

type PluginManagementPlugins struct {
	Plugin  []Plugin `xml:"plugin,omitempty"`
	Comment string   `xml:",comment"`
}

type PluginRepositories

type PluginRepositories struct {
	PluginRepository []Repository `xml:"pluginRepository,omitempty"`
	Comment          string       `xml:",comment"`
}

type Plugins

type Plugins struct {
	Plugin  []ReportPlugin `xml:"plugin,omitempty"`
	Comment string         `xml:",comment"`
}

type Prerequisites

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

type Profile

type Profile struct {
	Comment                string                  `xml:",comment"`
	Id                     string                  `xml:"id,omitempty"`
	Activation             *Activation             `xml:"activation,omitempty"`
	Build                  *BuildBase              `xml:"build,omitempty"`
	Modules                *Modules                `xml:"modules,omitempty"`
	DistributionManagement *DistributionManagement `xml:"distributionManagement,omitempty"`
	Properties             *Any                    `xml:"properties,omitempty"`
	DependencyManagement   *DependencyManagement   `xml:"dependencyManagement,omitempty"`
	Dependencies           *Dependencies           `xml:"dependencies,omitempty"`
	Repositories           *Repositories           `xml:"repositories,omitempty"`
	PluginRepositories     *PluginRepositories     `xml:"pluginRepositories,omitempty"`
	Reports                *Any                    `xml:"reports,omitempty"`
	Reporting              *Reporting              `xml:"reporting,omitempty"`
}

type Profiles

type Profiles struct {
	Comment string    `xml:",comment"`
	Profile []Profile `xml:"profile,omitempty"`
}

type Relocation

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

type ReportPlugin

type ReportPlugin struct {
	Comment       string      `xml:",comment"`
	GroupId       string      `xml:"groupId,omitempty"`
	ArtifactId    string      `xml:"artifactId,omitempty"`
	Version       string      `xml:"version,omitempty"`
	ReportSets    *ReportSets `xml:"reportSets,omitempty"`
	Inherited     string      `xml:"inherited,omitempty"`
	Configuration *Any        `xml:"configuration,omitempty"`
}

type ReportSet

type ReportSet struct {
	Comment       string   `xml:",comment"`
	Id            string   `xml:"id,omitempty"`
	Reports       *Reports `xml:"reports,omitempty"`
	Inherited     string   `xml:"inherited,omitempty"`
	Configuration *Any     `xml:"configuration,omitempty"`
}

type ReportSets

type ReportSets struct {
	Comment   string      `xml:",comment"`
	ReportSet []ReportSet `xml:"reportSet,omitempty"`
}

type Reporting

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

type Reports

type Reports struct {
	Comment string   `xml:",comment"`
	Report  []string `xml:"report,omitempty"`
}

type Repositories

type Repositories struct {
	Repository []Repository `xml:"repository,omitempty"`
	Comment    string       `xml:",comment"`
}

type Repository

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

type RepositoryPolicy

type RepositoryPolicy struct {
	Comment        string `xml:",comment"`
	Enabled        string `xml:"enabled,omitempty"`
	UpdatePolicy   string `xml:"updatePolicy,omitempty"`
	ChecksumPolicy string `xml:"checksumPolicy,omitempty"`
}

type Resource

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

type Resources

type Resources struct {
	Resource []Resource `xml:"resource,omitempty"`
	Comment  string     `xml:",comment"`
}

type Roles

type Roles struct {
	Role    []string `xml:"role,omitempty"`
	Comment string   `xml:",comment"`
}

type Scm

type Scm struct {
	Comment             string `xml:",comment"`
	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 {
	Comment string `xml:",comment"`
	Id      string `xml:"id,omitempty"`
	Name    string `xml:"name,omitempty"`
	Url     string `xml:"url,omitempty"`
}

type TestResources

type TestResources struct {
	TestResource []Resource `xml:"testResource,omitempty"`
	Comment      string     `xml:",comment"`
}

Jump to

Keyboard shortcuts

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