maven

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

mvn - Maven artifacts (Java packages, jars) in a Maven (mvn) repository (e.g. mvnrepository.com)

Synopsis
type: mvn/v1

Provided blobs use the following media type: application/x-tgz

Description

This method implements the access of a resource hosted by a maven repository or a complete resource set denoted by a GAV (GroupId, ArtifactId, Version).

Specification Versions

Supported specification version is v1

Version v1

The type specific specification fields are:

  • repository string

    Base URL of the Maven (mvn) repository

  • groupId string

    The groupId of the Maven (mvn) artifact

  • artifactId string

    The artifactId of the Maven (mvn) artifact

  • version string

    The version name of the Maven (mvn) artifact

  • classifier string

    The optional classifier of the Maven (mvn) artifact

  • extension string

    The optional extension of the Maven (mvn) artifact

If classifier/extension is given a dedicated resource is described, otherwise the complete resource set described by a GAV. Only complete resource sets can be uploaded again to a Maven repository.

Examples
Complete resource set denoted by a GAV
name: acme.org/complete/gav
version: 0.0.1
provider:
  name: acme.org
resources:
  - name: java-sap-vcap-services
    type: mvnArtifact
    version: 0.0.1
    access:
      type: mvn
      repository: https://repo1.maven.org/maven2
      groupId: com.sap.cloud.environment.servicebinding
      artifactId: java-sap-vcap-services
      version: 0.10.4
Single pom.xml file

This can't be uploaded again into a Maven repository, but it can be used to describe the dependencies of a project. The mime type will be application/xml.

name: acme.org/single/pom
version: 0.0.1
provider:
  name: acme.org
resources:
  - name: sap-cloud-sdk
    type: pom
    version: 0.0.1
    access:
      type: mvn
      repository: https://repo1.maven.org/maven2
      groupId: com.sap.cloud.sdk      
      artifactId: sdk-modules-bom
      version: 5.7.0
      classifier: ''
      extension: pom
Single binary file

In case you want to download and install maven itself, you can use the following example. This can't be uploaded again into a Maven repository. The mime type will be application/gzip.

name: acme.org/bin/zip
version: 0.0.1
provider:
  name: acme.org
resources:
  - name: maven
    type: bin
    version: 0.0.1
    access:
      type: mvn
      repository: https://repo1.maven.org/maven2
      groupId: org.apache.maven
      artifactId: apache-maven
      version: 3.9.6
      classifier: bin
      extension: zip

Documentation

Index

Constants

View Source
const (
	Type   = "maven"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Type is the access type of Maven repository.

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

Types

type AccessSpec

type AccessSpec struct {
	runtime.ObjectVersionedType `json:",inline"`

	// RepoUrl is the base URL of the Maven repository.
	RepoUrl string `json:"repoUrl"`

	maven.Coordinates `json:",inline"`
}

AccessSpec describes the access for a Maven artifact.

func New

func New(repository, groupId, artifactId, version string, opts ...Option) *AccessSpec

New creates a new Maven repository access spec version v1.

func NewForCoordinates

func NewForCoordinates(repository string, coords *maven.Coordinates, opts ...Option) *AccessSpec

NewForCoordinates creates a new Maven repository access spec version v1.

func (*AccessSpec) AccessMethod

func (*AccessSpec) ArtifactUrl

func (a *AccessSpec) ArtifactUrl() string

func (*AccessSpec) BaseUrl

func (a *AccessSpec) BaseUrl() string

func (*AccessSpec) Describe

func (a *AccessSpec) Describe(_ accspeccpi.Context) string

func (*AccessSpec) GetCoordinates

func (a *AccessSpec) GetCoordinates() *maven.Coordinates

func (*AccessSpec) GetReferenceHint

func (a *AccessSpec) GetReferenceHint(_ accspeccpi.ComponentVersionAccess) string

GetReferenceHint returns the reference hint for the Maven (mvn) artifact.

func (*AccessSpec) GetType

func (_ *AccessSpec) GetType() string

func (*AccessSpec) GlobalAccessSpec

func (a *AccessSpec) GlobalAccessSpec(_ accspeccpi.Context) accspeccpi.AccessSpec

func (*AccessSpec) IsLocal

func (_ *AccessSpec) IsLocal(accspeccpi.Context) bool

type Option

type Option = maven.CoordinateOption

Option defines the interface function "ApplyTo()".

func WithOptionalClassifier

func WithOptionalClassifier(c *string) Option

func WithOptionalExtension

func WithOptionalExtension(e *string) Option

type WithClassifier

type WithClassifier = maven.WithClassifier

type WithExtension

type WithExtension = maven.WithExtension

Jump to

Keyboard shortcuts

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