From bcb1ebe0e0d7c470dc0a78e565570c2701fef0d1 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Thu, 25 Oct 2007 19:58:14 +0000 Subject: [PATCH] use managed versions when resolving project dependencies from the plugin manager before executing a mojo, and include system path in system-scoped artifacts within the managed version map. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@588326 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/plugin/DefaultPluginManager.java | 4 ++-- .../apache/maven/project/DefaultMavenProjectBuilder.java | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 776441077b..da66839d9b 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -1385,7 +1385,7 @@ public class DefaultPluginManager ArtifactResolutionResult result = artifactResolver.resolveTransitively( project.getDependencyArtifacts(), artifact, - Collections.EMPTY_MAP, + project.getManagedVersionMap(), context.getLocalRepository(), project.getRemoteArtifactRepositories(), artifactMetadataSource, @@ -1424,7 +1424,7 @@ public class DefaultPluginManager if ( pluginRealm == null ) { getLogger().warn( "getPluginComponent(" + plugin + ", " + role + "): descriptor is missing classRealm" ); - + pluginRealm = container.getLookupRealm(); } 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 97c5d6501e..8b595e6ed0 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 @@ -340,6 +340,11 @@ public class DefaultMavenProjectBuilder Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), d.getClassifier(), d.getScope(), d.isOptional() ); + if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) && ( d.getSystemPath() != null ) ) + { + artifact.setFile( new File( d.getSystemPath() ) ); + } + if ( getLogger().isDebugEnabled() ) { getLogger().debug( " " + artifact ); @@ -1090,7 +1095,7 @@ public class DefaultMavenProjectBuilder } /** - * + * * @param projectId * @param plugins * @param pomLocation pom file