maven

package
v1.7.14 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPrefixSuffix = 2048

Variables

View Source
var ErrArtifactNotFound = errors.New("artifact not found")
View Source
var ErrCouldNotResolve = errors.New("ErrCouldNotResolve")
View Source
var ErrInvalidCoordinate = errors.New("invalid coordinate")
View Source
var ErrMvnCmd = errors.New("Maven command exit with error")
View Source
var ErrParsePomFailed = semerr.New("Parse pom failed.")
View Source
var MvnSkipped = model.NewInspectError(model.Java, "Mvn inspect is skipped, please check you maven environment.")

Functions

func InspectModule

func InspectModule(dir string) map[string]*PomBuilder

func New

func New() base.Inspector

func ScanMavenProject

func ScanMavenProject(task *model.InspectorTask) ([]model.Module, error)

Types

type Coordinate

type Coordinate struct {
	GroupId    string `json:"group_id"`
	ArtifactId string `json:"artifact_id"`
	Version    string `json:"version"`
}

func (Coordinate) Complete

func (c Coordinate) Complete() bool

func (Coordinate) HasVersion

func (c Coordinate) HasVersion() bool

func (Coordinate) IsBad

func (c Coordinate) IsBad() bool

func (Coordinate) Name

func (c Coordinate) Name() string

func (Coordinate) Normalize

func (c Coordinate) Normalize() Coordinate

func (Coordinate) String

func (c Coordinate) String() string

type DepGraph

type DepGraph map[Coordinate]map[Coordinate]struct{}

func (DepGraph) DOT

func (d DepGraph) DOT() string

func (DepGraph) Tree

func (d DepGraph) Tree(root Coordinate) []Dependency

type DepTreeAnalyzer

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

func NewDepTreeAnalyzer

func NewDepTreeAnalyzer(resolver *Resolver) *DepTreeAnalyzer

func (*DepTreeAnalyzer) Resolve

func (d *DepTreeAnalyzer) Resolve(p *PomFile) DepGraph

type DepTreeCacheMap

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

func (*DepTreeCacheMap) Get

func (d *DepTreeCacheMap) Get(coor Coordinate) *Dependency

func (*DepTreeCacheMap) Put

func (d *DepTreeCacheMap) Put(coor Coordinate, tree *Dependency)

type Dependency

type Dependency struct {
	Coordinate
	Children []Dependency `json:"children,omitempty"`
}

func (Dependency) String

func (d Dependency) String() string

type HttpRepo

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

func NewHttpRepo

func NewHttpRepo(baseUrl url.URL) *HttpRepo

func (*HttpRepo) Fetch

func (r *HttpRepo) Fetch(coordinate Coordinate) (*gopom.Project, error)

func (*HttpRepo) String

func (r *HttpRepo) String() string

type Inspector

type Inspector struct{}

func (*Inspector) CheckDir

func (i *Inspector) CheckDir(dir string) bool

func (*Inspector) InspectProject

func (i *Inspector) InspectProject(ctx context.Context) error

func (*Inspector) String

func (i *Inspector) String() string

type LocalRepo

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

func NewLocalRepo

func NewLocalRepo(s string) *LocalRepo

func (*LocalRepo) Fetch

func (l *LocalRepo) Fetch(coordinate Coordinate) (*gopom.Project, error)

func (*LocalRepo) String

func (l *LocalRepo) String() string

type M2Setting

type M2Setting struct {
	Mirrors  []string
	RepoPath string
}

type MvmCmdVersionInfo

type MvmCmdVersionInfo struct {
	MavenVer  string `json:"maven_ver"`
	JavaVer   string `json:"java_ver"`
	RawOutput string `json:"rawOutput"`
}

type MvnCmdExecutionStreamHandler added in v1.7.11

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

func NewMvnCmdExecution added in v1.7.11

func NewMvnCmdExecution() *MvnCmdExecutionStreamHandler

func (MvnCmdExecutionStreamHandler) String added in v1.7.11

func (*MvnCmdExecutionStreamHandler) Write added in v1.7.11

func (m *MvnCmdExecutionStreamHandler) Write(input []byte) (int, error)

type MvnOption

type MvnOption struct {
	LocalRepoPath string
	Remote        []string
}

func DefaultMvnOption

func DefaultMvnOption() MvnOption

func ReadMvnOption

func ReadMvnOption() MvnOption

func (MvnOption) String

func (o MvnOption) String() string

type PomBuilder

type PomBuilder struct {
	P *gopom.Project
	// Path pom文件路径
	Path      string
	ParentPom *PomFile
}

func NewPomBuilder

func NewPomBuilder(p *gopom.Project) *PomBuilder

func (*PomBuilder) Build

func (p *PomBuilder) Build() *PomFile

type PomDependencyItem

type PomDependencyItem struct {
	Coordinate
	Scope string
}

type PomFile

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

func NewPomFile

func NewPomFile() *PomFile

type Repo

type Repo interface {
	Fetch(coordinate Coordinate) (*gopom.Project, error)
}

type Resolver

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

func NewResolver

func NewResolver() *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(builder *PomBuilder, visitedCoor map[Coordinate]struct{}) *PomFile

Resolve 递归解析 pom,先查本地再查远程端

func (*Resolver) ResolveByCoordinate

func (r *Resolver) ResolveByCoordinate(coordinate Coordinate) *PomFile

func (*Resolver) ResolveLocally

func (r *Resolver) ResolveLocally(builder *PomBuilder, visitedCoor map[Coordinate]struct{}) *PomFile

Jump to

Keyboard shortcuts

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