Documentation
¶
Overview ¶
Package maven provides utility functions for working with Maven projects.
Index ¶
- Constants
- func CompareVersions(vk resolve.VersionKey, a *semver.Version, b *semver.Version) int
- func GetDependencyManagement(ctx context.Context, client *datasource.MavenRegistryAPIClient, ...) (maven.DependencyManagement, error)
- func MergeParents(ctx context.Context, mavenClient *datasource.MavenRegistryAPIClient, ...) error
- func ParentPOMPath(currentPath, relativePath string) string
- func ProjectKey(proj maven.Project) maven.ProjectKey
Constants ¶
const ( OriginManagement = "management" OriginParent = "parent" OriginPlugin = "plugin" OriginProfile = "profile" )
const MaxParent = 100
MaxParent sets a limit on the number of parents to avoid indefinite loop.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares two Maven semver versions with special behaviour for specific packages, producing more desirable ordering using non-standard comparison.
func GetDependencyManagement ¶
func GetDependencyManagement(ctx context.Context, client *datasource.MavenRegistryAPIClient, groupID, artifactID, version maven.String) (maven.DependencyManagement, error)
GetDependencyManagement returns managed dependencies in the specified Maven project by fetching remote pom.xml.
func MergeParents ¶
func MergeParents(ctx context.Context, mavenClient *datasource.MavenRegistryAPIClient, result *maven.Project, current maven.Parent, start int, path string, allowLocal bool) error
MergeParents parses local accessible parent pom.xml or fetches it from upstream, merges into root project, then interpolate the properties. result holds the merged Maven project. current holds the current parent project to merge. start indicates the index of the current parent project, which is used to check if the packaging has to be `pom`. allowLocal indicates whether parsing local parent pom.xml is allowed. path holds the path to the current pom.xml, which is used to compute the relative path of parent.
func ParentPOMPath ¶
ParentPOMPath resolves the path to the parent POM in the same manner as Maven.
That is, it first looks for the parent POM in the 'relativePath' directory, then in the parent directory, and finally in the remote repository.
func ProjectKey ¶
func ProjectKey(proj maven.Project) maven.ProjectKey
ProjectKey returns a project key with empty groupId/version filled by corresponding fields in parent.
Types ¶
This section is empty.