Documentation ¶
Index ¶
- func DownloadPomFromRepo(dep PomDependency, do func(r io.Reader), repos ...common.RepoConfig)
- func MvnTree(ctx context.Context, pom *Pom) *model.DepGraph
- func ParsePoms(ctx context.Context, poms []*Pom, exclusion []*Pom, ...)
- func RegisterMavenOrigin(origin func(groupId, artifactId, version string) *Pom)
- func RegisterMavenRepo(repos ...common.RepoConfig)
- type Pom
- type PomDependency
- func (dep PomDependency) Check() bool
- func (pd PomDependency) GAV() string
- func (dep PomDependency) ImportPath() []PomDependency
- func (dep PomDependency) ImportPathStack() string
- func (pd PomDependency) Index2() string
- func (pd PomDependency) Index3() string
- func (pd PomDependency) Index4() string
- func (pd PomDependency) NeedExclusion(dep PomDependency) bool
- type PomProperties
- type Property
- type Sca
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadPomFromRepo ¶
func DownloadPomFromRepo(dep PomDependency, do func(r io.Reader), repos ...common.RepoConfig)
DownloadPomFromRepo 从maven仓库下载pom dep: pom的dependency内容 do: 对http.Response.Body的操作 repos: 额外使用的maven仓库
func ParsePoms ¶
func ParsePoms(ctx context.Context, poms []*Pom, exclusion []*Pom, call func(pom *Pom, root *model.DepGraph))
ParsePoms 解析一个项目中的pom文件 poms: 项目中全部的pom文件列表 exclusion: 不需要解析的pom文件 call: 每个pom文件会解析成一个依赖图 返回对应的依赖图
func RegisterMavenOrigin ¶
RegisterMavenOrigin 注册maven数据源 origin: 获取数据源 gav=>pom
func RegisterMavenRepo ¶
func RegisterMavenRepo(repos ...common.RepoConfig)
Types ¶
type Pom ¶
type Pom struct { PomDependency Parent PomDependency `xml:"parent"` Properties PomProperties `xml:"properties"` DependencyManagement []*PomDependency `xml:"dependencyManagement>dependencies>dependency"` Dependencies []*PomDependency `xml:"dependencies>dependency"` Modules []string `xml:"modules>module"` Repositories []string `xml:"repositories>repository>url"` Mirrors []string `xml:"mirrors>mirror>url"` Licenses []string `xml:"licenses>license>name"` Profiles []Pom `xml:"profiles>profile"` File *model.File `xml:"-" json:"-"` }
func (*Pom) Update ¶
func (p *Pom) Update(dep *PomDependency)
type PomDependency ¶
type PomDependency struct { ArtifactId string `xml:"artifactId"` GroupId string `xml:"groupId"` Version string `xml:"version"` Type string `xml:"type"` Scope string `xml:"scope"` Classifier string `xml:"classifier"` RelativePath string `xml:"relativePath"` Optional bool `xml:"optional"` Exclusions []*PomDependency `xml:"exclusions>exclusion"` Define *Pom `xml:"-"` RefProperty *Property `xml:"-"` Start int `xml:",start"` End int `xml:",end"` }
func (PomDependency) Check ¶
func (dep PomDependency) Check() bool
func (PomDependency) ImportPath ¶
func (dep PomDependency) ImportPath() []PomDependency
ImportPath 引入路径
func (PomDependency) ImportPathStack ¶
func (dep PomDependency) ImportPathStack() string
ImportPathStack 引入路径栈
func (PomDependency) Index2 ¶
func (pd PomDependency) Index2() string
Index2 is groupId:artifactId:classifier:type
func (PomDependency) Index3 ¶
func (pd PomDependency) Index3() string
Index3 is groupId:artifactId:classifier:type:version
func (PomDependency) Index4 ¶
func (pd PomDependency) Index4() string
Index4 is groupId:artifactId:classifier:type:version:scope
func (PomDependency) NeedExclusion ¶
func (pd PomDependency) NeedExclusion(dep PomDependency) bool
type PomProperties ¶
func (*PomProperties) UnmarshalXML ¶
func (pp *PomProperties) UnmarshalXML(d *xml.Decoder, s xml.StartElement) error
Click to show internal directories.
Click to hide internal directories.