View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.repository.legacy.resolver.transform;
20  
21  import java.util.List;
22  
23  import org.apache.maven.artifact.Artifact;
24  import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
25  import org.apache.maven.artifact.installer.ArtifactInstallationException;
26  import org.apache.maven.artifact.repository.ArtifactRepository;
27  import org.apache.maven.artifact.repository.RepositoryRequest;
28  import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
29  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
30  
31  /**
32   * Manages multiple ArtifactTransformation instances and applies them in succession.
33   */
34  @Deprecated
35  public interface ArtifactTransformationManager {
36      String ROLE = ArtifactTransformationManager.class.getName();
37  
38      /**
39       * Take in an artifact and return the transformed artifact for locating in the remote repository. If no
40       * transformation has occurred the original artifact is returned.
41       *
42       * @param artifact           Artifact to be transformed.
43       * @param request the repositories to check
44       */
45      void transformForResolve(Artifact artifact, RepositoryRequest request)
46              throws ArtifactResolutionException, ArtifactNotFoundException;
47  
48      /**
49       * Take in an artifact and return the transformed artifact for locating in the remote repository. If no
50       * transformation has occurred the original artifact is returned.
51       *
52       * @param artifact           Artifact to be transformed.
53       * @param remoteRepositories the repositories to check
54       * @param localRepository    the local repository
55       */
56      void transformForResolve(
57              Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository)
58              throws ArtifactResolutionException, ArtifactNotFoundException;
59  
60      /**
61       * Take in an artifact and return the transformed artifact for locating in the local repository. If no
62       * transformation has occurred the original artifact is returned.
63       *
64       * @param artifact        Artifact to be transformed.
65       * @param localRepository the local repository it will be stored in
66       */
67      void transformForInstall(Artifact artifact, ArtifactRepository localRepository)
68              throws ArtifactInstallationException;
69  
70      /**
71       * Take in an artifact and return the transformed artifact for distributing to a remote repository. If no
72       * transformation has occurred the original artifact is returned.
73       *
74       * @param artifact         Artifact to be transformed.
75       * @param remoteRepository the repository to deploy to
76       * @param localRepository  the local repository the metadata is stored in
77       */
78      void transformForDeployment(
79              Artifact artifact, ArtifactRepository remoteRepository, ArtifactRepository localRepository)
80              throws ArtifactDeploymentException;
81  
82      List<ArtifactTransformation> getArtifactTransformations();
83  }