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.ProducedArtifact;
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 ArtifactFactory extends Service {
35
36
37
38
39
40
41
42
43 @Nonnull
44 Artifact create(@Nonnull ArtifactFactoryRequest request);
45
46 @Nonnull
47 default Artifact create(
48 @Nonnull Session session, String groupId, String artifactId, String version, String extension) {
49 return create(ArtifactFactoryRequest.build(session, groupId, artifactId, version, extension));
50 }
51
52 @Nonnull
53 default Artifact create(
54 @Nonnull Session session,
55 String groupId,
56 String artifactId,
57 String version,
58 String classifier,
59 String extension,
60 String type) {
61 return create(ArtifactFactoryRequest.build(session, groupId, artifactId, version, classifier, extension, type));
62 }
63
64
65
66
67
68
69
70
71 @Nonnull
72 ProducedArtifact createProduced(@Nonnull ArtifactFactoryRequest request);
73
74 @Nonnull
75 default ProducedArtifact createProduced(
76 @Nonnull Session session, String groupId, String artifactId, String version, String extension) {
77 return createProduced(ArtifactFactoryRequest.build(session, groupId, artifactId, version, extension));
78 }
79
80 @Nonnull
81 default ProducedArtifact createProduced(
82 @Nonnull Session session,
83 String groupId,
84 String artifactId,
85 String version,
86 String classifier,
87 String extension,
88 String type) {
89 return createProduced(
90 ArtifactFactoryRequest.build(session, groupId, artifactId, version, classifier, extension, type));
91 }
92 }