maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/lifecycle DefaultLifecycleExecutor.java
Date Sun, 27 Feb 2005 23:47:30 GMT
brett       2005/02/27 15:47:29

  Modified:    maven-core/src/main/java/org/apache/maven/lifecycle
                        DefaultLifecycleExecutor.java
  Log:
  simple recognition of plugin for current type
  
  Revision  Changes    Path
  1.9       +24 -14    maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
  
  Index: DefaultLifecycleExecutor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultLifecycleExecutor.java	27 Feb 2005 22:34:01 -0000	1.8
  +++ DefaultLifecycleExecutor.java	27 Feb 2005 23:47:29 -0000	1.9
  @@ -76,6 +76,9 @@
   
           try
           {
  +            // TODO: should enrich this with the type handler, but for now just use "type"
as is
  +            processPluginPhases( session.getProject().getType(), session );
  +
               processPluginConfiguration( session.getProject(), session );
   
               processGoalChain( tasks, session );
  @@ -124,20 +127,27 @@
               // TODO: should this flag be used in verifyPlugin, completely disabling the
plugin?
               if ( !plugin.isDisabled() )
               {
  -                if ( pluginManager.verifyPlugin( plugin.getId(), mavenSession ) )
  -                {
  -                    PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor(
plugin.getId() );
  -                    for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext();
)
  -                    {
  -                        MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
  +                String pluginId = plugin.getId();
  +                processPluginPhases( pluginId, mavenSession );
  +            }
  +        }
  +    }
   
  -                        // TODO: check if the goal exists in the configuration and is disabled
  -                        if ( mojoDescriptor.getPhase() != null )
  -                        {
  -                            Phase phase = (Phase) phaseMap.get( mojoDescriptor.getPhase()
);
  -                            phase.getGoals().add( mojoDescriptor.getId() );
  -                        }
  -                    }
  +    private void processPluginPhases( String pluginId, MavenSession mavenSession )
  +        throws Exception
  +    {
  +        if ( pluginManager.verifyPlugin( pluginId, mavenSession ) )
  +        {
  +            PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( pluginId
);
  +            for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); )
  +            {
  +                MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
  +
  +                // TODO: check if the goal exists in the configuration and is disabled
  +                if ( mojoDescriptor.getPhase() != null )
  +                {
  +                    Phase phase = (Phase) phaseMap.get( mojoDescriptor.getPhase() );
  +                    phase.getGoals().add( mojoDescriptor.getId() );
                   }
               }
           }
  
  
  

Mime
View raw message