-
Notifications
You must be signed in to change notification settings - Fork 23
/
maven.go
36 lines (28 loc) · 967 Bytes
/
maven.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package maven
import (
"github.com/mandelsoft/goutils/optionutils"
"github.com/mandelsoft/vfs/pkg/vfs"
"github.com/open-component-model/ocm/pkg/maven"
)
type (
BlobMeta = maven.FileMeta
Repository = maven.Repository
Coordinates = maven.Coordinates
)
func NewFileRepository(path string, fss ...vfs.FileSystem) *Repository {
return maven.NewFileRepository(path, fss...)
}
func NewUrlRepository(repoUrl string, fss ...vfs.FileSystem) (*Repository, error) {
return maven.NewUrlRepository(repoUrl, fss...)
}
type optionwrapper struct {
options *Options
}
func (o *optionwrapper) ApplyTo(opts *Coordinates) {
maven.WithOptionalExtension(o.options.Extension).ApplyTo(opts)
maven.WithOptionalClassifier(o.options.Classifier).ApplyTo(opts)
}
func NewCoordinates(groupId, artifactId, version string, opts ...Option) *Coordinates {
eff := optionutils.EvalOptions(opts...)
return maven.NewCoordinates(groupId, artifactId, version, &optionwrapper{eff})
}