View Javadoc

1   package org.apache.maven.artifact.repository;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  
24  import org.apache.maven.artifact.Artifact;
25  import org.apache.maven.artifact.metadata.ArtifactMetadata;
26  import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
27  import org.apache.maven.repository.Proxy;
28  
29  public interface ArtifactRepository
30  {
31      String pathOf( Artifact artifact );
32  
33      String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata );
34  
35      String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository );
36  
37      String getUrl();
38  
39      void setUrl( String url );
40  
41      String getBasedir();
42  
43      String getProtocol();
44  
45      String getId();
46  
47      void setId( String id );
48  
49      ArtifactRepositoryPolicy getSnapshots();
50  
51      void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy );
52  
53      ArtifactRepositoryPolicy getReleases();
54  
55      void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy );
56  
57      ArtifactRepositoryLayout getLayout();
58  
59      void setLayout( ArtifactRepositoryLayout layout );
60  
61      String getKey();
62  
63      @Deprecated
64      boolean isUniqueVersion();
65  
66      @Deprecated
67      boolean isBlacklisted();
68  
69      @Deprecated
70      void setBlacklisted( boolean blackListed );
71  
72      //
73      // New interface methods for the repository system.
74      //
75      /**
76       *
77       * @param artifact
78       * @return
79       * @since 3.0-alpha-3
80       */
81      Artifact find( Artifact artifact );
82  
83      /**
84       * Finds the versions of the specified artifact that are available in this repository.
85       *
86       * @param artifact The artifact whose available versions should be determined, must not be {@code null}.
87       * @return The available versions of the artifact or an empty list if none, never {@code null}.
88       * @since 3.0-alpha-3
89       */
90      List<String> findVersions( Artifact artifact );
91  
92      /**
93       * Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace
94       * are examples of such repositories.
95       *
96       * @return {@code true} if the repository is backed by actual projects, {@code false} otherwise.
97       * @since 3.0-beta-1
98       */
99      boolean isProjectAware();
100 
101     /**
102      * @since 3.0-alpha-3
103      */
104     void setAuthentication( Authentication authentication );
105     /**
106      * @since 3.0-alpha-3
107      */
108     Authentication getAuthentication();
109 
110     /**
111      * @since 3.0-alpha-3
112      */
113     void setProxy( Proxy proxy );
114     /**
115      * @since 3.0-alpha-3
116      */
117     Proxy getProxy();
118 
119     /**
120      * @since 3.0.3
121      * @return the repositories mirrored by the actual one
122      */
123     List<ArtifactRepository> getMirroredRepositories();
124 
125     /**
126      * @since 3.0.3
127      * @param mirroredRepositories the repositories that the actual one mirrors
128      */
129     void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories );
130 
131 }