You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ep...@apache.org on 2006/03/23 08:31:42 UTC
svn commit: r388083 -
/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
Author: epunzalan
Date: Wed Mar 22 23:31:40 2006
New Revision: 388083
URL: http://svn.apache.org/viewcvs?rev=388083&view=rev
Log:
Fixed a bug, apparently caused by a change in 2.0.3, that an artifact sent to a ResolutionListener have a null scope.
Modified:
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java?rev=388083&r1=388082&r2=388083&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java Wed Mar 22 23:31:40 2006
@@ -743,6 +743,10 @@
{
if ( !directDep.containsKey( artifact.getId() ) )
{
+ if ( artifact.getScope() == null )
+ {
+ artifact.setScope( Artifact.SCOPE_COMPILE );
+ }
directDep.put( artifact.getId(), artifact );
}
}
@@ -750,6 +754,13 @@
{
if ( !transitiveDep.containsKey( artifact.getId() ) )
{
+ if ( artifact.getScope() == null )
+ {
+ Artifact parent = (Artifact) parents.get( parents.size() );
+
+ artifact.setScope( parent.getScope() );
+ }
+
transitiveDep.put( artifact.getId(), artifact );
}
}
@@ -757,7 +768,19 @@
public void updateScope( Artifact artifact, String scope )
{
+ if ( directDep.containsKey( artifact.getId() ) )
+ {
+ Artifact depArtifact = (Artifact) directDep.get( artifact.getId() );
+
+ depArtifact.setScope( scope );
+ }
+ if ( transitiveDep.containsKey( artifact.getId() ) )
+ {
+ Artifact depArtifact = (Artifact) transitiveDep.get( artifact.getId() );
+
+ depArtifact.setScope( scope );
+ }
}
public void manageArtifact( Artifact artifact, Artifact replacement )
@@ -772,7 +795,7 @@
public void updateScopeCurrentPom( Artifact artifact, String scope )
{
-
+ updateScope( artifact, scope );
}
public void selectVersionFromRange( Artifact artifact )