You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by Jerome Lacoste <je...@coffeebreaks.org> on 2004/06/17 19:45:23 UTC
Re: cvs commit:
maven-components/maven-core/src/main/resources/org/apache/maven plexus.xml
On Thu, 2004-06-17 at 03:16, jvanzyl@apache.org wrote:
> jvanzyl 2004/06/16 18:16:03
>
> Modified: maven-core/src/main/java/org/apache/maven
> DefaultMavenCore.java
> maven-core/src/main/java/org/apache/maven/lifecycle/phase
> GoalAttainmentPhase.java
> maven-core/src/main/java/org/apache/maven/plugin
> DefaultPluginManager.java PluginManager.java
> maven-core/src/main/resources/org/apache/maven plexus.xml
> Log:
> o fixing a problem with transitive dependencies. temporarily doing the check
> in the goal attainment phase so i can make some more tests before tackling
> the lifecycle again.
>
> Revision Changes Path
> 1.4 +2 -2 maven-components/maven-core/src/main/java/org/apache/maven/DefaultMavenCore.java
>
> Index: DefaultMavenCore.java
> ===================================================================
> RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/DefaultMavenCore.java,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -r1.3 -r1.4
> --- DefaultMavenCore.java 17 Jun 2004 00:07:23 -0000 1.3
> +++ DefaultMavenCore.java 17 Jun 2004 01:16:02 -0000 1.4
> @@ -162,12 +162,12 @@
>
> public Map getGoalDescriptors()
> {
> - return pluginManager.getGoalDescriptors();
> + return pluginManager.getGoals();
> }
>
> public Goal getGoalDescriptor( String goalId )
> {
> - return pluginManager.getGoalDescriptor( goalId );
> + return pluginManager.getGoal( goalId );
> }
>
> // ----------------------------------------------------------------------
>
>
>
> 1.3 +34 -3 maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/phase/GoalAttainmentPhase.java
>
> Index: GoalAttainmentPhase.java
> ===================================================================
> RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/phase/GoalAttainmentPhase.java,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -r1.2 -r1.3
> --- GoalAttainmentPhase.java 17 Jun 2004 00:07:23 -0000 1.2
> +++ GoalAttainmentPhase.java 17 Jun 2004 01:16:02 -0000 1.3
> @@ -7,6 +7,10 @@
> import org.apache.maven.plugin.PluginExecutionResponse;
> import org.apache.maven.plugin.PluginManager;
> import org.apache.maven.plugin.descriptor.Goal;
> +import org.apache.maven.project.MavenProject;
> +import org.apache.maven.project.MavenProjectBuilder;
> +import org.apache.maven.artifact.collector.ArtifactCollector;
> +import org.apache.maven.artifact.collector.ArtifactCollectionResult;
>
> import java.util.Iterator;
> import java.util.List;
> @@ -25,20 +29,31 @@
>
> List goals = pluginManager.getGoals( context.getGoal().getName() );
>
> - PluginExecutionResponse response = new PluginExecutionResponse();
> + PluginExecutionResponse response;
>
> PluginExecutionRequest request;
>
> + boolean transitiveDependenciesResolved = false;
> +
> for ( Iterator it = goals.iterator(); it.hasNext(); )
> {
> String goalName = (String) it.next();
>
> - Goal goal = pluginManager.getGoalDescriptor( goalName );
> + Goal goal = pluginManager.getGoal( goalName );
>
> System.out.println( "[" + goal.getName() + "]" );
>
> + if ( goal.requiresDependencyResolution() && ! transitiveDependenciesResolved )
> + {
> + resolveTransitiveDependencies( context );
> +
> + transitiveDependenciesResolved = true;
> + }
nitpick: might be better to test the boolean before the method call.
J