From cc20bf64026c2289cd6a08fbb8def43921bb8875 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Wed, 11 Jan 2006 03:45:10 +0000 Subject: [PATCH] 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 --- .../artifact/manager/DefaultWagonManager.java | 1 - maven-core-it/it0043/pom.xml | 2 +- maven-core-it/it0075/goals.txt | 2 +- maven-core/pom.xml | 15 ++---- .../project/DefaultMavenProjectBuilder.java | 53 +++++++++++++------ pom.xml | 13 +++-- 6 files changed, 53 insertions(+), 33 deletions(-) diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java index 5ac769b868..d166e8d129 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java @@ -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 ) { diff --git a/maven-core-it/it0043/pom.xml b/maven-core-it/it0043/pom.xml index 544714ec98..3fe0c476fd 100644 --- a/maven-core-it/it0043/pom.xml +++ b/maven-core-it/it0043/pom.xml @@ -32,7 +32,7 @@ - maven-projecthelp-plugin + maven-help-plugin generate-test-resources diff --git a/maven-core-it/it0075/goals.txt b/maven-core-it/it0075/goals.txt index 8bafbdc228..9d0b4edabe 100644 --- a/maven-core-it/it0075/goals.txt +++ b/maven-core-it/it0075/goals.txt @@ -1,4 +1,4 @@ -projecthelp:active-profiles +help:active-profiles package eclipse:eclipse clean:clean diff --git a/maven-core/pom.xml b/maven-core/pom.xml index 2764dd5c47..b27091b479 100644 --- a/maven-core/pom.xml +++ b/maven-core/pom.xml @@ -143,16 +143,11 @@ org.apache.maven.wagon wagon-ssh runtime - - - plexus-utils - plexus - - - plexus-container-default - org.codehaus.plexus - - + + + org.apache.maven.wagon + wagon-ssh-external + runtime org.codehaus.plexus diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index b38e8e1281..7e5b087fa1 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -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; + } + } } diff --git a/pom.xml b/pom.xml index e553c9af70..1bb4072842 100644 --- a/pom.xml +++ b/pom.xml @@ -287,22 +287,27 @@ org.apache.maven.wagon wagon-provider-api - 1.0-alpha-5 + 1.0-alpha-6-SNAPSHOT org.apache.maven.wagon wagon-ssh - 1.0-alpha-5 + 1.0-alpha-6-SNAPSHOT + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-6-SNAPSHOT org.apache.maven.wagon wagon-file - 1.0-alpha-5 + 1.0-alpha-6-SNAPSHOT org.apache.maven.wagon wagon-http-lightweight - 1.0-alpha-5 + 1.0-alpha-6-SNAPSHOT