Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 73180 invoked from network); 21 Aug 2007 17:59:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 17:59:54 -0000 Received: (qmail 90268 invoked by uid 500); 21 Aug 2007 17:59:51 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 90219 invoked by uid 500); 21 Aug 2007 17:59:50 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 90206 invoked by uid 99); 21 Aug 2007 17:59:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 10:59:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 18:00:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1839F1A981A; Tue, 21 Aug 2007 10:59:30 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r568219 - in /maven/components/branches/maven-2.0.x: maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/ maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ Date: Tue, 21 Aug 2007 17:59:29 -0000 To: commits@maven.apache.org From: carlos@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070821175930.1839F1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 );