make the detection cleaner to make it easier to clean up later

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163628 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-21 04:00:46 +00:00
parent dab33490a5
commit f5bd920140
4 changed files with 15 additions and 18 deletions

View File

@ -381,7 +381,19 @@ public class DefaultPluginManager
plugin.setLog( session.getLog() );
if ( plugin.supportsNewMojoParadigm() )
// TODO: remove
boolean newMojoTechnique = false;
try
{
plugin.getClass().getDeclaredMethod( "execute", new Class[0] );
newMojoTechnique = true;
}
catch ( NoSuchMethodException e )
{
// intentionally ignored
}
if ( newMojoTechnique )
{
populateParameters( plugin, mojoDescriptor, session );
}
@ -398,7 +410,7 @@ public class DefaultPluginManager
dispatcher.dispatchStart( event, goalName );
try
{
if ( plugin.supportsNewMojoParadigm() )
if ( newMojoTechnique )
{
plugin.execute();
}

View File

@ -83,14 +83,6 @@ public abstract class AbstractPlugin
public void execute()
throws PluginExecutionException
{
if ( supportsNewMojoParadigm() )
{
throw new PluginExecutionException( "You must override execute() if you implement the new paradigm" );
}
}
public boolean supportsNewMojoParadigm()
{
return false;
throw new PluginExecutionException( "You must override execute() if you implement the new paradigm" );
}
}

View File

@ -35,7 +35,4 @@ public interface Plugin
// TODO: not sure about this here, and may want a getLog on here as well/instead
void setLog( Log log );
/** @deprecated */
boolean supportsNewMojoParadigm();
}

View File

@ -42,10 +42,6 @@ public class CleanPlugin
// TODO: not in the descriptor previously
// private boolean failOnError;
public boolean supportsNewMojoParadigm()
{
return true;
}
public void execute()
throws PluginExecutionException