mirror of https://github.com/apache/maven.git
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:
parent
dab33490a5
commit
f5bd920140
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue