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.artifact.resolver;
20  
21  import org.apache.maven.artifact.Artifact;
22  import org.apache.maven.artifact.versioning.VersionRange;
23  
24  /**
25   * Listens to the resolution process and handles events.
26   */
27  @Deprecated
28  public interface ResolutionListener {
29      String ROLE = ResolutionListener.class.getName();
30  
31      int TEST_ARTIFACT = 1;
32  
33      int PROCESS_CHILDREN = 2;
34  
35      int FINISH_PROCESSING_CHILDREN = 3;
36  
37      int INCLUDE_ARTIFACT = 4;
38  
39      int OMIT_FOR_NEARER = 5;
40  
41      int UPDATE_SCOPE = 6;
42  
43      @Deprecated
44      int MANAGE_ARTIFACT = 7;
45  
46      int OMIT_FOR_CYCLE = 8;
47  
48      /**
49       * this event means that the artifactScope has NOT been updated to a farther node artifactScope because current
50       * node is in the first level pom
51       */
52      int UPDATE_SCOPE_CURRENT_POM = 9;
53  
54      int SELECT_VERSION_FROM_RANGE = 10;
55  
56      int RESTRICT_RANGE = 11;
57  
58      int MANAGE_ARTIFACT_VERSION = 12;
59  
60      int MANAGE_ARTIFACT_SCOPE = 13;
61  
62      int MANAGE_ARTIFACT_SYSTEM_PATH = 14;
63  
64      void testArtifact(Artifact node);
65  
66      void startProcessChildren(Artifact artifact);
67  
68      void endProcessChildren(Artifact artifact);
69  
70      void includeArtifact(Artifact artifact);
71  
72      void omitForNearer(Artifact omitted, Artifact kept);
73  
74      void updateScope(Artifact artifact, String scope);
75  
76      @Deprecated
77      void manageArtifact(Artifact artifact, Artifact replacement);
78  
79      // TODO Remove ResolutionListenerDM interface
80  
81      void omitForCycle(Artifact artifact);
82  
83      /**
84       * This event means that the artifactScope has NOT been updated to a farther node artifactScope because current
85       * node is in the first level pom
86       *
87       * @param artifact     current node artifact, the one in the first level pom
88       * @param ignoredScope artifactScope that was ignored because artifact was in first level pom
89       */
90      void updateScopeCurrentPom(Artifact artifact, String ignoredScope);
91  
92      void selectVersionFromRange(Artifact artifact);
93  
94      void restrictRange(Artifact artifact, Artifact replacement, VersionRange newRange);
95  }