mirror of https://github.com/apache/maven.git
o rolling back change, not sure how subclipse commits to two separate repositories in one commit..
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@696679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82beb43aa7
commit
6282ce0b0e
|
@ -35,6 +35,7 @@ import org.apache.maven.profiles.build.ProfileAdvisor;
|
|||
import org.apache.maven.project.ProjectBuilderConfiguration;
|
||||
import org.apache.maven.project.ProjectBuildingException;
|
||||
import org.apache.maven.project.ModelAndFile;
|
||||
import org.apache.maven.project.workspace.ProjectWorkspace;
|
||||
import org.codehaus.plexus.logging.LogEnabled;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
||||
|
@ -68,6 +69,8 @@ public class DefaultModelLineageBuilder
|
|||
|
||||
private ProfileAdvisor profileAdvisor;
|
||||
|
||||
private ProjectWorkspace projectWorkspace;
|
||||
|
||||
private Logger logger;
|
||||
|
||||
public DefaultModelLineageBuilder()
|
||||
|
@ -96,7 +99,12 @@ public class DefaultModelLineageBuilder
|
|||
List currentRemoteRepositories = remoteRepositories == null ? new ArrayList()
|
||||
: new ArrayList( remoteRepositories );
|
||||
|
||||
ModelAndFile current = new ModelAndFile( readModel( pom ), pom, isReactorProject );
|
||||
ModelAndFile current = projectWorkspace.getModelAndFile( pom );
|
||||
if ( current == null )
|
||||
{
|
||||
current = new ModelAndFile( readModel( pom ), pom, isReactorProject );
|
||||
projectWorkspace.storeModelAndFile( current );
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -306,6 +314,7 @@ public class DefaultModelLineageBuilder
|
|||
|
||||
// getLogger().debug( "Checking cache for parent model-and-file instance: " + key + " using file: " + parentPomFile );
|
||||
|
||||
result = projectWorkspace.getModelAndFile( parentPomFile );
|
||||
if ( result != null && !parentModelMatches( modelParent, result.getModel() ) )
|
||||
{
|
||||
parentPomFile = null;
|
||||
|
@ -313,6 +322,13 @@ public class DefaultModelLineageBuilder
|
|||
}
|
||||
}
|
||||
|
||||
if ( result == null )
|
||||
{
|
||||
// getLogger().debug( "Checking cache for parent model-and-file instance: " + key + " using project groupId:artifactId:version." );
|
||||
|
||||
result = projectWorkspace.getModelAndFile( modelParent.getGroupId(), modelParent.getArtifactId(), modelParent.getVersion() );
|
||||
}
|
||||
|
||||
if ( result != null )
|
||||
{
|
||||
// getLogger().debug( "Returning cached instance." );
|
||||
|
@ -405,6 +421,12 @@ public class DefaultModelLineageBuilder
|
|||
}
|
||||
}
|
||||
|
||||
if ( result != null )
|
||||
{
|
||||
// getLogger().debug( "Caching parent model-and-file: " + result );
|
||||
projectWorkspace.storeModelAndFile( result );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue