mirror of https://github.com/apache/maven.git
[MNG-4359] [regression] Locally reachable parent POMs outside of reactor are not found during dependency resolution
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@815327 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
588907b593
commit
2dc6a5313c
|
@ -35,6 +35,9 @@ import org.apache.maven.artifact.versioning.VersionRange;
|
|||
public interface Artifact
|
||||
extends Comparable<Artifact>
|
||||
{
|
||||
|
||||
String RELEASE_VERSION = "RELEASE";
|
||||
|
||||
String LATEST_VERSION = "LATEST";
|
||||
|
||||
String SNAPSHOT_VERSION = "SNAPSHOT";
|
||||
|
@ -59,8 +62,6 @@ public interface Artifact
|
|||
|
||||
String SCOPE_IMPORT = "import"; // Used to import dependencyManagement dependencies
|
||||
|
||||
String RELEASE_VERSION = "RELEASE";
|
||||
|
||||
String getGroupId();
|
||||
|
||||
String getArtifactId();
|
||||
|
|
|
@ -179,6 +179,7 @@ public class DefaultWagonManager
|
|||
|
||||
if ( artifact.isResolved() )
|
||||
{
|
||||
artifact.setRepository( repository );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,9 +46,7 @@ public class ReactorArtifactRepository
|
|||
{
|
||||
if ( "pom".equals( artifact.getType() ) )
|
||||
{
|
||||
artifact.setFile( project.getFile() );
|
||||
|
||||
artifact.setResolved( true );
|
||||
resolve( artifact, project.getFile() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -62,9 +60,7 @@ public class ReactorArtifactRepository
|
|||
// If we are running before the packaging phase there is going to be no archive anyway, but if we are running prior to package
|
||||
// we shouldn't even take the archive anyway.
|
||||
|
||||
artifact.setFile( projectArtifact.getFile() );
|
||||
|
||||
artifact.setResolved( true );
|
||||
resolve( artifact, projectArtifact.getFile() );
|
||||
}
|
||||
else if ( isProjectOutputValid( project ) )
|
||||
{
|
||||
|
@ -81,9 +77,7 @@ public class ReactorArtifactRepository
|
|||
|
||||
if ( classesDir.isDirectory() )
|
||||
{
|
||||
artifact.setFile( classesDir );
|
||||
|
||||
artifact.setResolved( true );
|
||||
resolve( artifact, classesDir );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +86,15 @@ public class ReactorArtifactRepository
|
|||
return artifact;
|
||||
}
|
||||
|
||||
private void resolve( Artifact artifact, File file )
|
||||
{
|
||||
artifact.setFile( file );
|
||||
|
||||
artifact.setResolved( true );
|
||||
|
||||
artifact.setRepository( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId()
|
||||
{
|
||||
|
|
|
@ -209,7 +209,9 @@ public class DefaultProjectBuilder
|
|||
"Error resolving project artifact: " + e.getMessage(), e );
|
||||
}
|
||||
|
||||
return build( artifact.getFile(), false, configuration );
|
||||
boolean localProject = artifact.getRepository() != null && "reactor".equals( artifact.getRepository().getId() );
|
||||
|
||||
return build( artifact.getFile(), localProject, configuration );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue