Documentation ¶
Index ¶
- Constants
- Variables
- func InspectModule(dir string) map[string]*PomBuilder
- func New() base.Inspector
- func ScanMavenProject(task *model.InspectorTask) ([]model.Module, error)
- type Coordinate
- type DepGraph
- type DepTreeAnalyzer
- type DepTreeCacheMap
- type Dependency
- type HttpRepo
- type Inspector
- type LocalRepo
- type M2Setting
- type MvmCmdVersionInfo
- type MvnCmdExecutionStreamHandler
- type MvnOption
- type PomBuilder
- type PomDependencyItem
- type PomFile
- type Repo
- type Resolver
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 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) 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 ¶
type LocalRepo ¶
type LocalRepo struct {
// contains filtered or unexported fields
}
func NewLocalRepo ¶
type MvmCmdVersionInfo ¶
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 (m MvnCmdExecutionStreamHandler) String() string
type MvnOption ¶
func DefaultMvnOption ¶
func DefaultMvnOption() MvnOption
func ReadMvnOption ¶
func ReadMvnOption() MvnOption
type PomBuilder ¶
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 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
Click to show internal directories.
Click to hide internal directories.