Return-Path: Delivered-To: apmail-maven-m2-dev-archive@www.apache.org Received: (qmail 45678 invoked from network); 27 Feb 2005 23:47:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Feb 2005 23:47:31 -0000 Received: (qmail 75247 invoked by uid 500); 27 Feb 2005 23:47:31 -0000 Delivered-To: apmail-maven-m2-dev-archive@maven.apache.org Received: (qmail 75224 invoked by uid 500); 27 Feb 2005 23:47:31 -0000 Mailing-List: contact m2-dev-help@maven.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Maven 2 Developers List" Reply-To: "Maven 2 Developers List" Delivered-To: mailing list m2-dev@maven.apache.org Received: (qmail 75210 invoked by uid 500); 27 Feb 2005 23:47:31 -0000 Delivered-To: apmail-maven-components-cvs@apache.org Received: (qmail 75207 invoked by uid 99); 27 Feb 2005 23:47:31 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 27 Feb 2005 15:47:31 -0800 Received: (qmail 45673 invoked by uid 1717); 27 Feb 2005 23:47:30 -0000 Date: 27 Feb 2005 23:47:30 -0000 Message-ID: <20050227234730.45672.qmail@minotaur.apache.org> From: brett@apache.org To: maven-components-cvs@apache.org Subject: cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/lifecycle DefaultLifecycleExecutor.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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() ); } } }