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-plugin/src/main/java/org/apache/maven/plugin AbstractPlugin.java Plugin.java
Date Mon, 21 Mar 2005 04:00:46 GMT
brett       2005/03/20 20:00:46

  Modified:    maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean
                        CleanPlugin.java
               maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
               maven-plugin/src/main/java/org/apache/maven/plugin
                        AbstractPlugin.java Plugin.java
  Log:
  make the detection cleaner to make it easier to clean up later
  
  Revision  Changes    Path
  1.6       +1 -5      maven-components/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java
  
  Index: CleanPlugin.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanPlugin.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CleanPlugin.java	21 Mar 2005 03:49:17 -0000	1.5
  +++ CleanPlugin.java	21 Mar 2005 04:00:45 -0000	1.6
  @@ -42,10 +42,6 @@
   
       // TODO: not in the descriptor previously
   //    private boolean failOnError;
  -    public boolean supportsNewMojoParadigm()
  -    {
  -        return true;
  -    }
   
       public void execute()
           throws PluginExecutionException
  
  
  
  1.62      +14 -2     maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- DefaultPluginManager.java	21 Mar 2005 03:49:17 -0000	1.61
  +++ DefaultPluginManager.java	21 Mar 2005 04:00:46 -0000	1.62
  @@ -381,7 +381,19 @@
   
               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 @@
               dispatcher.dispatchStart( event, goalName );
               try
               {
  -                if ( plugin.supportsNewMojoParadigm() )
  +                if ( newMojoTechnique )
                   {
                       plugin.execute();
                   }
  
  
  
  1.7       +2 -10     maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/AbstractPlugin.java
  
  Index: AbstractPlugin.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/AbstractPlugin.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractPlugin.java	21 Mar 2005 03:49:17 -0000	1.6
  +++ AbstractPlugin.java	21 Mar 2005 04:00:46 -0000	1.7
  @@ -83,14 +83,6 @@
       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" );
       }
   }
  
  
  
  1.7       +1 -4      maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/Plugin.java
  
  Index: Plugin.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/Plugin.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Plugin.java	21 Mar 2005 01:02:36 -0000	1.6
  +++ Plugin.java	21 Mar 2005 04:00:46 -0000	1.7
  @@ -35,7 +35,4 @@
   
       // TODO: not sure about this here, and may want a getLog on here as well/instead
       void setLog( Log log );
  -
  -    /** @deprecated */
  -    boolean supportsNewMojoParadigm();
   }
  
  
  

Mime
View raw message