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 br...@apache.org on 2005/02/27 23:34:01 UTC
cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/lifecycle DefaultLifecycleExecutor.java
brett 2005/02/27 14:34:01
Modified: maven-model maven.mdo
maven-core/src/main/java/org/apache/maven/lifecycle
DefaultLifecycleExecutor.java
Log:
allow plugins to be disabled (to override inheritence)
Revision Changes Path
1.76 +12 -0 maven-components/maven-model/maven.mdo
Index: maven.mdo
===================================================================
RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- maven.mdo 24 Feb 2005 04:16:18 -0000 1.75
+++ maven.mdo 27 Feb 2005 22:34:00 -0000 1.76
@@ -1612,6 +1612,12 @@
<type>String</type>
</field>
<field>
+ <name>disabled</name>
+ <version>4.0.0</version>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ </field>
+ <field>
<name>configuration</name>
<type>Properties</type>
<association xml.mapStyle="inline">
@@ -1639,6 +1645,12 @@
<type>String</type>
</field>
<field>
+ <name>disabled</name>
+ <version>4.0.0</version>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ </field>
+ <field>
<name>configuration</name>
<type>Properties</type>
<association xml.mapStyle="inline">
1.8 +14 -9 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DefaultLifecycleExecutor.java 27 Feb 2005 21:22:18 -0000 1.7
+++ DefaultLifecycleExecutor.java 27 Feb 2005 22:34:01 -0000 1.8
@@ -121,17 +121,22 @@
{
Plugin plugin = (Plugin) i.next();
- if ( pluginManager.verifyPlugin( plugin.getId(), mavenSession ) )
+ // TODO: should this flag be used in verifyPlugin, completely disabling the plugin?
+ if ( !plugin.isDisabled() )
{
- PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( plugin.getId() );
- for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); )
+ if ( pluginManager.verifyPlugin( plugin.getId(), mavenSession ) )
{
- MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
-
- if ( mojoDescriptor.getPhase() != null )
+ PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor( plugin.getId() );
+ for ( Iterator j = pluginDescriptor.getMojos().iterator(); j.hasNext(); )
{
- Phase phase = (Phase) phaseMap.get( mojoDescriptor.getPhase() );
- phase.getGoals().add( mojoDescriptor.getId() );
+ 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() );
+ }
}
}
}