merge from branch maven-2.0.x @ rev 367900

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@367902 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-01-11 03:45:10 +00:00
parent 191af0e678
commit cc20bf6402
6 changed files with 53 additions and 33 deletions

View File

@ -721,7 +721,6 @@ public class DefaultWagonManager
componentConfigurator = (ComponentConfigurator) container.lookup( ComponentConfigurator.ROLE );
componentConfigurator.configureComponent( wagon, (PlexusConfiguration) serverConfigurationMap
.get( repositoryId ), container.getContainerRealm() );
System.out.println( "done" );
}
catch ( final ComponentLookupException e )
{

View File

@ -32,7 +32,7 @@
<build>
<plugins>
<plugin>
<artifactId>maven-projecthelp-plugin</artifactId>
<artifactId>maven-help-plugin</artifactId>
<executions>
<execution>
<phase>generate-test-resources</phase>

View File

@ -1,4 +1,4 @@
projecthelp:active-profiles
help:active-profiles
package
eclipse:eclipse
clean:clean

View File

@ -143,16 +143,11 @@
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>plexus-utils</artifactId>
<groupId>plexus</groupId>
</exclusion>
<exclusion>
<artifactId>plexus-container-default</artifactId>
<groupId>org.codehaus.plexus</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>

View File

@ -289,8 +289,7 @@ public class DefaultMavenProjectBuilder
Model model = readModel( "unknown", projectDescriptor, true );
// Always cache files in the source tree over those in the repository
MavenProject p = new MavenProject( model );
p.setFile( projectDescriptor );
CachedModel cachedModel = new CachedModel( projectDescriptor, model );
String modelKey = createCacheKey( model.getGroupId(), model.getArtifactId(), model.getVersion() );
if ( modelCache.containsKey( modelKey ) )
@ -299,7 +298,7 @@ public class DefaultMavenProjectBuilder
"Duplicate project ID found in " +
projectDescriptor.getAbsolutePath() );
}
modelCache.put( modelKey, p );
modelCache.put( modelKey, cachedModel );
MavenProject project = build( projectDescriptor.getAbsolutePath(), model, localRepository,
buildArtifactRepositories( getSuperModel() ),
@ -375,10 +374,10 @@ public class DefaultMavenProjectBuilder
artifact.getVersion(), artifact.getScope() );
}
MavenProject project = getCachedProject( projectArtifact.getGroupId(), projectArtifact.getArtifactId(),
projectArtifact.getVersion() );
CachedModel cachedModel = getCachedProject( projectArtifact.getGroupId(), projectArtifact.getArtifactId(),
projectArtifact.getVersion() );
Model model;
if ( project == null )
if ( cachedModel == null )
{
String projectId = ArtifactUtils.versionlessKey( projectArtifact );
@ -434,7 +433,7 @@ public class DefaultMavenProjectBuilder
}
else
{
model = project.getModel();
model = cachedModel.getModel();
}
return model;
@ -696,9 +695,8 @@ public class DefaultMavenProjectBuilder
if ( !modelCache.containsKey( key ) )
{
// clone the model because the profile injection below will modify this instance
MavenProject p = new MavenProject( ModelUtils.cloneModel( model ) );
p.setFile( project.getFile() );
modelCache.put( key, p );
CachedModel cachedModel = new CachedModel( project.getFile(), ModelUtils.cloneModel( model ) );
modelCache.put( key, cachedModel );
}
List activeProfiles = project.getActiveProfiles();
@ -879,12 +877,12 @@ public class DefaultMavenProjectBuilder
// the only way this will have a value is if we find the parent on disk...
File parentDescriptor = null;
MavenProject p =
CachedModel cachedModel =
getCachedProject( parentModel.getGroupId(), parentModel.getArtifactId(), parentModel.getVersion() );
if ( p != null )
if ( cachedModel != null )
{
model = p.getModel();
parentDescriptor = p.getFile();
model = cachedModel.getModel();
parentDescriptor = cachedModel.getDescriptor();
}
else
{
@ -1158,9 +1156,9 @@ public class DefaultMavenProjectBuilder
}
}
private MavenProject getCachedProject( String groupId, String artifactId, String version )
private CachedModel getCachedProject( String groupId, String artifactId, String version )
{
return (MavenProject) modelCache.get( createCacheKey( groupId, artifactId, version ) );
return (CachedModel) modelCache.get( createCacheKey( groupId, artifactId, version ) );
}
private static String createCacheKey( String groupId, String artifactId, String version )
@ -1366,4 +1364,27 @@ public class DefaultMavenProjectBuilder
{
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
private static class CachedModel
{
private File descriptor;
private Model model;
public CachedModel( File descriptor, Model model )
{
this.descriptor = descriptor;
this.model = model;
}
public File getDescriptor()
{
return descriptor;
}
public Model getModel()
{
return model;
}
}
}

13
pom.xml
View File

@ -287,22 +287,27 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-5</version>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-alpha-5</version>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>1.0-alpha-5</version>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0-alpha-5</version>
<version>1.0-alpha-6-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>