Author: carlos Date: Tue Aug 21 10:59:28 2007 New Revision: 568219 URL: http://svn.apache.org/viewvc?rev=568219&view=rev Log: Add docs about updateScopeCurrentPom event. Merged rev 568217
Modified: maven/components/branches/maven-2.0.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java Modified: maven/components/branches/maven-2.0.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java?rev=568219&r1=568218&r2=568219&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java (original) +++ maven/components/branches/maven-2.0.x/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DebugResolutionListener.java Tue Aug 21 10:59:28 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/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java?rev=568219&r1=568218&r2=568219&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (original) +++ maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java Tue Aug 21 10:59:28 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/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java?rev=568219&r1=568218&r2=568219&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java (original) +++ maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java Tue Aug 21 10:59:28 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 );