maven

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package maven provides bare-bones utilities for analysing maven projects.

Some functions in this package assume mvn to be in your PATH.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EffectiveModule

type EffectiveModule struct {
	Header
	Dependencies []Identity `xml:"dependencies>dependency"`
}

An EffectiveModule contains the interesting parts of the mvn help:effective-pom output for a single-module project.

type EffectivePom

type EffectivePom struct {
	Projects []EffectiveModule `xml:"project"`
}

An EffectivePom contains the interesting parts of the mvn help:effective-pom output for a multi-module project.

func ParseEffectivePom

func ParseEffectivePom(r io.Reader) (EffectivePom, error)

func ParseEffectivePomOfClone

func ParseEffectivePomOfClone(ctx context.Context, cln repo.Local) (EffectivePom, error)
type Header struct {
	Parent Identity `xml:"parent"`
	Identity
}

A Header corresponds to the parts of a POM that determine the identity of a maven module.

func (Header) EffectiveArtifactID

func (head Header) EffectiveArtifactID() string

EffectiveArtifactID is the artifactId of a POM. If an artifactId was not specified explicitly, the parent one is used.

func (Header) EffectiveGroupID

func (head Header) EffectiveGroupID() string

EffectiveGroupID is the groupId of a POM. If a groupId was not specified explicitly, the parent one is used.

func (Header) EffectiveIdentity

func (head Header) EffectiveIdentity() Identity

EffectiveIdentity calculates the effective identity of a module based on it's Header.

func (Header) EffectiveVersion

func (head Header) EffectiveVersion() string

EffectiveVersion is the version of a POM. If a version was not specified explicitly, the parent one is used.

func (Header) Validate

func (head Header) Validate() error

Validate reports issues with the header value.

type Identity

type Identity struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
}

An Identity of a maven module.

type Project

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

A Project that is built using maven.

func NewProject

func NewProject(ctx context.Context, clone repo.Local) (Project, error)

NewProject attempts to create a maven project given a locally cloned repository.

func (Project) Build

func (prj Project) Build(ctx context.Context, logTo io.Writer) error

func (Project) Builds

func (prj Project) Builds() []unibuild.RequirementVersion

func (Project) Info

func (prj Project) Info() unibuild.ProjectInfo

func (Project) Uses

func (prj Project) Uses() []unibuild.Requirement

type Requirement

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

func NewRequirement

func NewRequirement(id Identity) Requirement

func (Requirement) ID

Jump to

Keyboard shortcuts

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