maven

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package maven provides utility functions for working with Maven projects.

Index

Constants

View Source
const (
	OriginManagement = "management"
	OriginParent     = "parent"
	OriginPlugin     = "plugin"
	OriginProfile    = "profile"
)
View Source
const MaxParent = 100

MaxParent sets a limit on the number of parents to avoid indefinite loop.

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(vk resolve.VersionKey, a *semver.Version, b *semver.Version) int

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

func ParentPOMPath(currentPath, relativePath string) string

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.

Jump to

Keyboard shortcuts

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