mirror of https://github.com/apache/maven.git
[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:
parent
87b687615b
commit
2ce2f9bf2a
|
@ -2031,35 +2031,38 @@ public class MavenProject
|
|||
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 )
|
||||
{
|
||||
if ( a.getType().equals( "test-jar" ) )
|
||||
list.add( file.getPath() );
|
||||
}
|
||||
else
|
||||
{
|
||||
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() ) )
|
||||
{
|
||||
list.add( testOutputDir.getAbsolutePath() );
|
||||
File testOutputDir = new File( project.getBuild().getTestOutputDirectory() );
|
||||
if ( testOutputDir.exists() )
|
||||
{
|
||||
list.add( testOutputDir.getAbsolutePath() );
|
||||
projectDirFound = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue