mavenutil

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mavenutil provides utilities for merging Maven pom/xml.

Index

Constants

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

Origin of the dependencies.

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 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, input *filesystem.ScanInput, mavenClient *datasource.MavenRegistryAPIClient, result *maven.Project, current maven.Parent, initialParentIndex int, 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 Maven project to merge into, this is modified in place.
  • current holds the current parent project to merge.
  • parentIndex 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 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