1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.api.services;
20
21 import org.apache.maven.api.Artifact;
22 import org.apache.maven.api.ArtifactCoordinates;
23 import org.apache.maven.api.Service;
24 import org.apache.maven.api.Session;
25 import org.apache.maven.api.annotations.Experimental;
26 import org.apache.maven.api.annotations.Nonnull;
27
28
29
30
31
32
33 @Experimental
34 public interface ArtifactCoordinatesFactory extends Service {
35
36
37
38
39
40
41
42
43 @Nonnull
44 ArtifactCoordinates create(@Nonnull ArtifactCoordinatesFactoryRequest request);
45
46
47
48
49
50
51
52
53
54
55 @Nonnull
56 default ArtifactCoordinates create(@Nonnull Session session, @Nonnull String coordinatesString) {
57 return create(ArtifactCoordinatesFactoryRequest.build(session, coordinatesString));
58 }
59
60 @Nonnull
61 default ArtifactCoordinates create(
62 @Nonnull Session session, String groupId, String artifactId, String version, String extension) {
63 return create(ArtifactCoordinatesFactoryRequest.build(session, groupId, artifactId, version, extension));
64 }
65
66 @Nonnull
67 default ArtifactCoordinates create(
68 @Nonnull Session session,
69 String groupId,
70 String artifactId,
71 String version,
72 String classifier,
73 String extension,
74 String type) {
75 return create(ArtifactCoordinatesFactoryRequest.build(
76 session, groupId, artifactId, version, classifier, extension, type));
77 }
78
79 @Nonnull
80 default ArtifactCoordinates create(@Nonnull Session session, Artifact artifact) {
81 return create(ArtifactCoordinatesFactoryRequest.build(
82 session,
83 artifact.getGroupId(),
84 artifact.getArtifactId(),
85 artifact.getVersion().asString(),
86 artifact.getClassifier(),
87 artifact.getExtension(),
88 null));
89 }
90 }