You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/02/24 23:38:35 UTC

svn commit: r747588 - in /maven/components/trunk: ./ maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Author: bentmann
Date: Tue Feb 24 22:38:35 2009
New Revision: 747588

URL: http://svn.apache.org/viewvc?rev=747588&view=rev
Log:
[MNG-2720] Multiproject dependencies not accurate for project.compileClasspathElements when run from root project

o Basically merged from r741841 but I opted to leave in the resolution from project directories since I am not sure whether this can safely be removed right now

Modified:
    maven/components/trunk/   (props changed)
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Propchange: maven/components/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 24 22:38:35 2009
@@ -1,7 +1,7 @@
 /maven/components/branches/MNG-3932-1:746145-746157
 /maven/components/branches/maven-2.0.10-RC:680477
 /maven/components/branches/maven-2.0.x:679206,708871,720042,726541,727548,727998,728264,728940,729060,729738,729785,730631
-/maven/components/branches/maven-2.1.x:739385,747468
+/maven/components/branches/maven-2.1.x:739385,741841,747468
 /maven/components/branches/sisbell-plugin-manager:738973-739966
 /maven/components/sisbell-plugin-manager:738757-738972
 /maven/components/trunk:688587-696625,696644-699681

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=747588&r1=747587&r2=747588&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java Tue Feb 24 22:38:35 2009
@@ -2031,35 +2031,38 @@
     private void addArtifactPath( Artifact a, List<String> list )
         throws DependencyResolutionRequiredException
     {
-        String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(), a.getVersion() );
-        MavenProject project = (MavenProject) projectReferences.get( refId );
-
-        boolean projectDirFound = false;
-        if ( project != null )
+        File file = a.getFile();
+        if ( file != null )
+        {
+            list.add( file.getPath() );
+        }
+        else
         {
-            if ( a.getType().equals( "test-jar" ) )
+            String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(), a.getVersion() );
+            MavenProject project = (MavenProject) projectReferences.get( refId );
+
+            boolean projectDirFound = false;
+            if ( project != null )
             {
-                File testOutputDir = new File( project.getBuild().getTestOutputDirectory() );
-                if ( testOutputDir.exists() )
+                if ( "test-jar".equals( a.getType() ) )
+                {
+                    File testOutputDir = new File( project.getBuild().getTestOutputDirectory() );
+                    if ( testOutputDir.exists() )
+                    {
+                        list.add( testOutputDir.getAbsolutePath() );
+                        projectDirFound = true;
+                    }
+                }
+                else
                 {
-                    list.add( testOutputDir.getAbsolutePath() );
+                    list.add( project.getBuild().getOutputDirectory() );
                     projectDirFound = true;
                 }
             }
-            else
-            {
-                list.add( project.getBuild().getOutputDirectory() );
-                projectDirFound = true;
-            }
-        }
-        if ( !projectDirFound )
-        {
-            File file = a.getFile();
-            if ( file == null )
+            if ( !projectDirFound )
             {
                 throw new DependencyResolutionRequiredException( a );
             }
-            list.add( file.getPath() );
         }
     }