1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.api;
20
21 import java.nio.file.Path;
22 import java.util.List;
23 import java.util.Optional;
24
25 import org.apache.maven.api.annotations.Experimental;
26 import org.apache.maven.api.annotations.Nonnull;
27 import org.apache.maven.api.model.Build;
28 import org.apache.maven.api.model.Model;
29
30
31
32
33
34
35
36 @Experimental
37 public interface Project {
38
39 @Nonnull
40 String getGroupId();
41
42 @Nonnull
43 String getArtifactId();
44
45 @Nonnull
46 String getVersion();
47
48 @Nonnull
49 String getPackaging();
50
51 @Nonnull
52 Artifact getArtifact();
53
54 @Nonnull
55 Model getModel();
56
57 @Nonnull
58 default Build getBuild() {
59 Build build = getModel().getBuild();
60 return build != null ? build : Build.newInstance();
61 }
62
63
64
65
66
67
68
69
70 @Nonnull
71 Optional<Path> getPomPath();
72
73 @Nonnull
74 default Optional<Path> getBasedir() {
75 return getPomPath().map(Path::getParent);
76 }
77
78 @Nonnull
79 List<DependencyCoordinate> getDependencies();
80
81 @Nonnull
82 List<DependencyCoordinate> getManagedDependencies();
83
84 @Nonnull
85 default String getId() {
86 return getModel().getId();
87 }
88
89 boolean isExecutionRoot();
90
91 @Nonnull
92 Optional<Project> getParent();
93
94 @Nonnull
95 List<RemoteRepository> getRemoteProjectRepositories();
96
97 @Nonnull
98 List<RemoteRepository> getRemotePluginRepositories();
99 }