KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > resolver > WarningResolutionListener


1 package org.apache.maven.artifact.resolver;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * 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, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.artifact.Artifact;
20 import org.apache.maven.artifact.versioning.VersionRange;
21 import org.codehaus.plexus.logging.Logger;
22
23 import java.util.HashSet JavaDoc;
24 import java.util.Set JavaDoc;
25
26 /**
27  * Send resolution warning events to the warning log.
28  *
29  * @author <a HREF="mailto:brett@apache.org">Brett Porter</a>
30  * @version $Id: WarningResolutionListener.java 307309 2005-10-08 16:30:28Z brett $
31  */

32 public class WarningResolutionListener
33     implements ResolutionListener
34 {
35     private Logger logger;
36
37     private static Set JavaDoc ignoredArtifacts = new HashSet JavaDoc();
38
39     public WarningResolutionListener( Logger logger )
40     {
41         this.logger = logger;
42     }
43
44     public void testArtifact( Artifact node )
45     {
46     }
47
48     public void startProcessChildren( Artifact artifact )
49     {
50     }
51
52     public void endProcessChildren( Artifact artifact )
53     {
54     }
55
56     public void includeArtifact( Artifact artifact )
57     {
58     }
59
60     public void omitForNearer( Artifact omitted, Artifact kept )
61     {
62     }
63
64     public void omitForCycle( Artifact omitted )
65     {
66     }
67
68     public void updateScopeCurrentPom( Artifact artifact, String JavaDoc scope )
69     {
70         // TODO: better way than static? this might hide messages in a reactor
71
if ( !ignoredArtifacts.contains( artifact ) )
72         {
73             logger.warn( "\n\tArtifact " + artifact + " retains local scope '" + artifact.getScope() +
74                 "' overriding broader scope '" + scope + "'\n" +
75                 "\tgiven by a dependency. If this is not intended, modify or remove the local scope.\n" );
76             ignoredArtifacts.add( artifact );
77         }
78     }
79
80     public void updateScope( Artifact artifact, String JavaDoc scope )
81     {
82     }
83
84     public void manageArtifact( Artifact artifact, Artifact replacement )
85     {
86     }
87
88     public void selectVersionFromRange( Artifact artifact )
89     {
90     }
91
92     public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange )
93     {
94     }
95 }
96
Popular Tags