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
|
public interface Artifact
|
||||||
extends Comparable<Artifact>
|
extends Comparable<Artifact>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
String RELEASE_VERSION = "RELEASE";
|
||||||
|
|
||||||
String LATEST_VERSION = "LATEST";
|
String LATEST_VERSION = "LATEST";
|
||||||
|
|
||||||
String SNAPSHOT_VERSION = "SNAPSHOT";
|
String SNAPSHOT_VERSION = "SNAPSHOT";
|
||||||
|
@ -59,8 +62,6 @@ public interface Artifact
|
||||||
|
|
||||||
String SCOPE_IMPORT = "import"; // Used to import dependencyManagement dependencies
|
String SCOPE_IMPORT = "import"; // Used to import dependencyManagement dependencies
|
||||||
|
|
||||||
String RELEASE_VERSION = "RELEASE";
|
|
||||||
|
|
||||||
String getGroupId();
|
String getGroupId();
|
||||||
|
|
||||||
String getArtifactId();
|
String getArtifactId();
|
||||||
|
|
|
@ -179,6 +179,7 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
if ( artifact.isResolved() )
|
if ( artifact.isResolved() )
|
||||||
{
|
{
|
||||||
|
artifact.setRepository( repository );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,7 @@ public class ReactorArtifactRepository
|
||||||
{
|
{
|
||||||
if ( "pom".equals( artifact.getType() ) )
|
if ( "pom".equals( artifact.getType() ) )
|
||||||
{
|
{
|
||||||
artifact.setFile( project.getFile() );
|
resolve( artifact, project.getFile() );
|
||||||
|
|
||||||
artifact.setResolved( true );
|
|
||||||
}
|
}
|
||||||
else
|
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
|
// 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.
|
// we shouldn't even take the archive anyway.
|
||||||
|
|
||||||
artifact.setFile( projectArtifact.getFile() );
|
resolve( artifact, projectArtifact.getFile() );
|
||||||
|
|
||||||
artifact.setResolved( true );
|
|
||||||
}
|
}
|
||||||
else if ( isProjectOutputValid( project ) )
|
else if ( isProjectOutputValid( project ) )
|
||||||
{
|
{
|
||||||
|
@ -81,9 +77,7 @@ public class ReactorArtifactRepository
|
||||||
|
|
||||||
if ( classesDir.isDirectory() )
|
if ( classesDir.isDirectory() )
|
||||||
{
|
{
|
||||||
artifact.setFile( classesDir );
|
resolve( artifact, classesDir );
|
||||||
|
|
||||||
artifact.setResolved( true );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +86,15 @@ public class ReactorArtifactRepository
|
||||||
return artifact;
|
return artifact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resolve( Artifact artifact, File file )
|
||||||
|
{
|
||||||
|
artifact.setFile( file );
|
||||||
|
|
||||||
|
artifact.setResolved( true );
|
||||||
|
|
||||||
|
artifact.setRepository( this );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getId()
|
public String getId()
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,7 +209,9 @@ public class DefaultProjectBuilder
|
||||||
"Error resolving project artifact: " + e.getMessage(), e );
|
"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