1 package org.apache.maven.repository;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.List;
24
25 import org.apache.maven.artifact.Artifact;
26 import org.apache.maven.artifact.InvalidRepositoryException;
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
29 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
30 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
31 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
32 import org.apache.maven.model.Dependency;
33 import org.apache.maven.model.Plugin;
34 import org.apache.maven.model.Repository;
35 import org.apache.maven.settings.Mirror;
36 import org.apache.maven.settings.Server;
37 import org.eclipse.aether.RepositorySystemSession;
38
39
40
41
42
43 public interface RepositorySystem
44 {
45 String DEFAULT_LOCAL_REPO_ID = "local";
46
47 String userHome = System.getProperty( "user.home" );
48
49 File userMavenConfigurationHome = new File( userHome, ".m2" );
50
51 File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" );
52
53 String DEFAULT_REMOTE_REPO_ID = "central";
54
55 String DEFAULT_REMOTE_REPO_URL = "http://repo.maven.apache.org/maven2";
56
57 Artifact createArtifact( String groupId, String artifactId, String version, String packaging );
58
59 Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type );
60
61 Artifact createProjectArtifact( String groupId, String artifactId, String version );
62
63 Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type,
64 String classifier );
65
66 Artifact createPluginArtifact( Plugin plugin );
67
68 Artifact createDependencyArtifact( Dependency dependency );
69
70 ArtifactRepository buildArtifactRepository( Repository repository )
71 throws InvalidRepositoryException;
72
73 ArtifactRepository createDefaultRemoteRepository()
74 throws InvalidRepositoryException;
75
76 ArtifactRepository createDefaultLocalRepository()
77 throws InvalidRepositoryException;
78
79 ArtifactRepository createLocalRepository( File localRepository )
80 throws InvalidRepositoryException;
81
82 ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout,
83 ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
84
85
86
87
88
89
90
91
92
93
94 List<ArtifactRepository> getEffectiveRepositories( List<ArtifactRepository> repositories );
95
96
97
98
99
100
101
102
103 Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors );
104
105
106
107
108
109
110
111
112
113
114 void injectMirror( List<ArtifactRepository> repositories, List<Mirror> mirrors );
115
116
117
118
119
120
121
122
123
124
125 void injectProxy( List<ArtifactRepository> repositories, List<org.apache.maven.settings.Proxy> proxies );
126
127
128
129
130
131
132
133
134
135
136 void injectAuthentication( List<ArtifactRepository> repositories, List<Server> servers );
137
138 void injectMirror( RepositorySystemSession session, List<ArtifactRepository> repositories );
139
140 void injectProxy( RepositorySystemSession session, List<ArtifactRepository> repositories );
141
142 void injectAuthentication( RepositorySystemSession session, List<ArtifactRepository> repositories );
143
144 ArtifactResolutionResult resolve( ArtifactResolutionRequest request );
145
146
147
148
149
150
151
152
153
154
155 void publish( ArtifactRepository repository, File source, String remotePath,
156 ArtifactTransferListener transferListener )
157 throws ArtifactTransferFailedException;
158
159 void retrieve( ArtifactRepository repository, File destination, String remotePath,
160 ArtifactTransferListener transferListener )
161 throws ArtifactTransferFailedException, ArtifactDoesNotExistException;
162
163 }