mirror of https://github.com/apache/maven.git
o Made project cache sensitive to file modifications
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@775307 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a9f90cc8f3
commit
d616f1d873
|
@ -107,7 +107,9 @@ public class DefaultMavenProjectBuilder
|
||||||
public MavenProject build( File pomFile, ProjectBuilderConfiguration configuration )
|
public MavenProject build( File pomFile, ProjectBuilderConfiguration configuration )
|
||||||
throws ProjectBuildingException
|
throws ProjectBuildingException
|
||||||
{
|
{
|
||||||
MavenProject project = projectCache.get( pomFile.getAbsolutePath() );
|
String cacheKey = getCacheKey( pomFile, configuration );
|
||||||
|
|
||||||
|
MavenProject project = projectCache.get( cacheKey );
|
||||||
|
|
||||||
if ( project != null )
|
if ( project != null )
|
||||||
{
|
{
|
||||||
|
@ -211,11 +213,19 @@ public class DefaultMavenProjectBuilder
|
||||||
project.setFile( pomFile );
|
project.setFile( pomFile );
|
||||||
project.setActiveProfiles( projectProfiles );
|
project.setActiveProfiles( projectProfiles );
|
||||||
|
|
||||||
projectCache.put( pomFile.getAbsolutePath(), project );
|
projectCache.put( cacheKey, project );
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCacheKey( File pomFile, ProjectBuilderConfiguration configuration )
|
||||||
|
{
|
||||||
|
StringBuilder buffer = new StringBuilder( 256 );
|
||||||
|
buffer.append( pomFile.getAbsolutePath() );
|
||||||
|
buffer.append( '/' ).append( pomFile.lastModified() );
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public MavenProject buildFromRepository( Artifact artifact, ProjectBuilderConfiguration configuration )
|
public MavenProject buildFromRepository( Artifact artifact, ProjectBuilderConfiguration configuration )
|
||||||
throws ProjectBuildingException
|
throws ProjectBuildingException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue