[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

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@747588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-02-24 22:38:35 +00:00
parent 87b687615b
commit 2ce2f9bf2a
1 changed files with 23 additions and 20 deletions

View File

@ -2030,6 +2030,13 @@ public class MavenProject
private void addArtifactPath( Artifact a, List<String> list )
throws DependencyResolutionRequiredException
{
File file = a.getFile();
if ( file != null )
{
list.add( file.getPath() );
}
else
{
String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId(), a.getVersion() );
MavenProject project = (MavenProject) projectReferences.get( refId );
@ -2037,7 +2044,7 @@ public class MavenProject
boolean projectDirFound = false;
if ( project != null )
{
if ( a.getType().equals( "test-jar" ) )
if ( "test-jar".equals( a.getType() ) )
{
File testOutputDir = new File( project.getBuild().getTestOutputDirectory() );
if ( testOutputDir.exists() )
@ -2053,13 +2060,9 @@ public class MavenProject
}
}
if ( !projectDirFound )
{
File file = a.getFile();
if ( file == null )
{
throw new DependencyResolutionRequiredException( a );
}
list.add( file.getPath() );
}
}