1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.project.artifact;
20
21 import java.util.Collection;
22 import java.util.Set;
23
24 import org.apache.maven.artifact.Artifact;
25 import org.apache.maven.lifecycle.LifecycleExecutionException;
26 import org.apache.maven.project.DependencyResolutionResult;
27 import org.apache.maven.project.MavenProject;
28 import org.eclipse.aether.RepositorySystemSession;
29
30
31
32
33
34
35
36 public interface ProjectArtifactsCache {
37
38
39
40
41 interface Key {
42
43 }
44
45 interface ArtifactsSetWithResult extends Set<Artifact> {
46 DependencyResolutionResult getResult();
47 }
48
49
50
51
52 class CacheRecord {
53
54 private final Set<Artifact> artifacts;
55
56 private final LifecycleExecutionException exception;
57
58 CacheRecord(Set<Artifact> artifacts) {
59 this.artifacts = artifacts;
60 this.exception = null;
61 }
62
63 CacheRecord(LifecycleExecutionException exception) {
64 this.artifacts = null;
65 this.exception = exception;
66 }
67
68 public Set<Artifact> getArtifacts() {
69 return artifacts;
70 }
71
72 public LifecycleExecutionException getException() {
73 return exception;
74 }
75 }
76
77 Key createKey(
78 MavenProject project,
79 Collection<String> scopesToCollect,
80 Collection<String> scopesToResolve,
81 boolean aggregating,
82 RepositorySystemSession session);
83
84 CacheRecord get(Key key) throws LifecycleExecutionException;
85
86 CacheRecord put(Key key, Set<Artifact> pluginArtifacts);
87
88 CacheRecord put(Key key, LifecycleExecutionException e);
89
90 void flush();
91
92
93
94
95
96
97
98
99
100 void register(MavenProject project, Key cacheKey, CacheRecord record);
101 }