You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2007/08/21 19:54:34 UTC

svn commit: r568217 - in /maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver: DebugResolutionListener.java DefaultArtifactCollector.java ResolutionListener.java

Author: carlos
Date: Tue Aug 21 10:54:34 2007
New Revision: 568217

URL: http://svn.apache.org/viewvc?rev=568217&view=rev
Log:
Add docs about updateScopeCurrentPom event

Modified:
    maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java
    maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
    maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java

Modified: maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java
URL: http://svn.apache.org/viewvc/maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java?rev=568217&r1=568216&r2=568217&view=diff
==============================================================================
--- maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java (original)
+++ maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java Tue Aug 21 10:54:34 2007
@@ -81,16 +81,16 @@
         logger.debug( indent + omitted + " (removed - causes a cycle in the graph)" );
     }
 
-    public void updateScopeCurrentPom( Artifact artifact, String scope )
+    public void updateScopeCurrentPom( Artifact artifact, String ignoredScope )
     {
-        logger.debug( indent + artifact + " (not setting scope to: " + scope + "; local scope " + artifact.getScope() +
+        logger.debug( indent + artifact + " (not setting scope to: " + ignoredScope + "; local scope " + artifact.getScope() +
             " wins)" );
 
         // TODO: better way than static? this might hide messages in a reactor
         if ( !ignoredArtifacts.contains( artifact ) )
         {
             logger.warn( "\n\tArtifact " + artifact + " retains local scope '" + artifact.getScope() +
-                "' overriding broader scope '" + scope + "'\n" +
+                "' overriding broader scope '" + ignoredScope + "'\n" +
                 "\tgiven by a dependency. If this is not intended, modify or remove the local scope.\n" );
             ignoredArtifacts.add( artifact );
         }

Modified: maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java?rev=568217&r1=568216&r2=568217&view=diff
==============================================================================
--- maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (original)
+++ maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java Tue Aug 21 10:54:34 2007
@@ -414,6 +414,7 @@
         Artifact farthestArtifact = farthest.getArtifact();
         Artifact nearestArtifact = nearest.getArtifact();
 
+        /* farthest is runtime and nearest has lower priority, change to runtime */
         if ( Artifact.SCOPE_RUNTIME.equals( farthestArtifact.getScope() ) && (
             Artifact.SCOPE_TEST.equals( nearestArtifact.getScope() ) ||
                 Artifact.SCOPE_PROVIDED.equals( nearestArtifact.getScope() ) ) )
@@ -421,13 +422,14 @@
             updateScope = true;
         }
 
+        /* farthest is compile and nearest is not (has lower priority), change to compile */
         if ( Artifact.SCOPE_COMPILE.equals( farthestArtifact.getScope() ) &&
             !Artifact.SCOPE_COMPILE.equals( nearestArtifact.getScope() ) )
         {
             updateScope = true;
         }
 
-        // current POM rules all
+        /* current POM rules all, if nearest is in current pom, do not update its scope */
         if ( nearest.getDepth() < 2 && updateScope )
         {
             updateScope = false;

Modified: maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java
URL: http://svn.apache.org/viewvc/maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java?rev=568217&r1=568216&r2=568217&view=diff
==============================================================================
--- maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java (original)
+++ maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java Tue Aug 21 10:54:34 2007
@@ -51,6 +51,10 @@
 
     int OMIT_FOR_CYCLE = 8;
 
+    /**
+     * this event means that the scope has NOT been updated to a farther node scope because current
+     * node is in the first level pom
+     */
     int UPDATE_SCOPE_CURRENT_POM = 9;
 
     int SELECT_VERSION_FROM_RANGE = 10;
@@ -87,7 +91,14 @@
 
     void omitForCycle( Artifact artifact );
 
-    void updateScopeCurrentPom( Artifact artifact, String scope );
+    /**
+     * This event means that the scope has NOT been updated to a farther node scope because current
+     * node is in the first level pom
+     * 
+     * @param artifact current node artifact, the one in the first level pom
+     * @param ignoredScope scope that was ignored because artifact was in first level pom
+     */
+    void updateScopeCurrentPom( Artifact artifact, String ignoredScope );
 
     void selectVersionFromRange( Artifact artifact );