mavenmetadata

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MavenMetadata

type MavenMetadata struct {
	GroupID    string     `xml:"groupId"`
	ArtifactID string     `xml:"artifactId"`
	Version    string     `xml:"version"`
	Versioning Versioning `xml:"versioning"`
}

MavenMetadata is the top-level structure for unmarshaled Maven Metadata XML

func Parse

func Parse(input []byte) (*MavenMetadata, error)

Parse parses a byte array containing marshaled Maven Metadata XML data and returned an unmarshaled MavenMetadata structure

func (*MavenMetadata) LatestVersion

func (m *MavenMetadata) LatestVersion() (string, error)

func (*MavenMetadata) ReleaseVersion

func (m *MavenMetadata) ReleaseVersion() (string, error)

func (*MavenMetadata) SnapshotResolvedVersion

func (m *MavenMetadata) SnapshotResolvedVersion(filetype string) string

SnapshotResolvedFileName returns resolved artifact version if SNAPSHOT version is enabled, set the SNAPSHOT artifact name based on match conditions Snapshot.Timestamp, Snapshot.BuildNumber and Version.Extension

type SnapshotElement

type SnapshotElement struct {
	Timestamp   string `xml:"timestamp"`
	BuildNumber string `xml:"buildNumber"`
}

type SnapshotVersion

type SnapshotVersion struct {
	Extension string `xml:"extension"`
	Value     string `xml:"value"`
	Updated   string `xml:"updated"`
}

type SnapshotVersions

type SnapshotVersions struct {
	SnapshotVersion []SnapshotVersion `xml:"snapshotVersion"`
}

type VersionType

type VersionType string
const (
	Latest   VersionType = "LATEST"
	Release  VersionType = "RELEASE"
	Snapshot VersionType = "SNAPSHOT"
	Version  VersionType = "VERSION"
	Range    VersionType = "RANGE"
	Unknown  VersionType = "UNKNOWN"
)

type Versioning

type Versioning struct {
	Latest           string           `xml:"latest"`
	Release          string           `xml:"release"`
	Versions         Versions         `xml:"versions"`
	LastUpdated      string           `xml:"lastUpdated"`
	SnapshotVersions SnapshotVersions `xml:"snapshotVersions"`
	Snapshot         SnapshotElement  `xml:"snapshot"`
}

Versioning is the structure for the unmarshaled 'versioning' field in Maven Metadata XML

type Versions

type Versions struct {
	Version []string `xml:"version"`
}

Versions is the structure for the unmarshaled 'Version' array field in Maven Metadata XML

Jump to

Keyboard shortcuts

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