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-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin AbstractGeneratorMojo.java BeanGeneratorMojo.java DescriptorGeneratorMojo.java JellyGeneratorMojo.java AbstractPluginMojo.java PluginFailureResponse.java
Date Tue, 22 Mar 2005 13:44:17 GMT
brett       2005/03/22 05:44:17

  Modified:    maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin
                        AbstractGeneratorMojo.java BeanGeneratorMojo.java
                        DescriptorGeneratorMojo.java
                        JellyGeneratorMojo.java
  Removed:     maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin
                        AbstractPluginMojo.java PluginFailureResponse.java
  Log:
  convert plugin plugin to new execute()
  
  Revision  Changes    Path
  1.3       +37 -22    maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
  
  Index: AbstractGeneratorMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractGeneratorMojo.java	20 Feb 2005 16:25:20 -0000	1.2
  +++ AbstractGeneratorMojo.java	22 Mar 2005 13:44:17 -0000	1.3
  @@ -1,8 +1,23 @@
   package org.apache.maven.plugin.plugin;
   
  +/*
  + * Copyright 2001-2005 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
   import org.apache.maven.plugin.AbstractPlugin;
  -import org.apache.maven.plugin.PluginExecutionRequest;
  -import org.apache.maven.plugin.PluginExecutionResponse;
  +import org.apache.maven.plugin.PluginExecutionException;
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.tools.plugin.scanner.MojoScanner;
   
  @@ -15,28 +30,28 @@
   public abstract class AbstractGeneratorMojo
       extends AbstractPlugin
   {
  +    protected String outputDirectory;
  +
  +    protected MavenProject project;
  +
  +    protected MojoScanner mojoScanner;
  +
       protected abstract void generate( String outputDirectory, Set mavenMojoDescriptors,
MavenProject project )
           throws Exception;
   
  -    public void execute( PluginExecutionRequest request, PluginExecutionResponse response
)
  -        throws Exception
  +    public void execute()
  +        throws PluginExecutionException
       {
  -        // ----------------------------------------------------------------------
  -        //
  -        // ----------------------------------------------------------------------
  -
  -        String outputDirectory = (String) request.getParameter( "outputDirectory" );
  -
  -        MavenProject project = (MavenProject)request.getParameter( "project" );
  -        
  -        MojoScanner scanner = (MojoScanner)request.getParameter("mojoScanner");
  -        
  -        Set mavenMojoDescriptors = scanner.execute(project);
  -
  -        // ----------------------------------------------------------------------
  -        //
  -        // ----------------------------------------------------------------------
  -
  -        generate( outputDirectory, mavenMojoDescriptors, project );
  +        try
  +        {
  +            Set mavenMojoDescriptors = mojoScanner.execute( project );
  +
  +            generate( outputDirectory, mavenMojoDescriptors, project );
  +        }
  +        catch ( Exception e )
  +        {
  +            // TODO: improve error handling
  +            throw new PluginExecutionException( "Error generating plugin descriptor", e
);
  +        }
       }
   }
  
  
  
  1.5       +36 -26    maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java
  
  Index: BeanGeneratorMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/BeanGeneratorMojo.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanGeneratorMojo.java	20 Feb 2005 16:25:20 -0000	1.4
  +++ BeanGeneratorMojo.java	22 Mar 2005 13:44:17 -0000	1.5
  @@ -1,39 +1,49 @@
   package org.apache.maven.plugin.plugin;
   
  +/*
  + * Copyright 2001-2005 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.tools.plugin.generator.BeanGenerator;
   
   import java.util.Set;
   
   /**
  - * @goal bean
  - *
  - * @description Goal for generating a plugin descriptor.
  - *
  - * @parameter
  - *  name="mojoScanner"
  - *  type="org.apache.maven.tools.plugin.scanner.MojoScanner"
  - *  required="true"
  - *  validator=""
  - *  expression="#component.org.apache.maven.tools.plugin.scanner.MojoScanner"
  - *  description="Scanner used to discover mojo descriptors from this project"
  - * @parameter
  - *  name="project"
  - *  type="org.apache.maven.project.MavenProject"
  - *  required="true"
  - *  validator=""
  - *  expression="#project"
  - *  description=""
  - * @parameter
  - *  name="outputDirectory"
  - *  type="String"
  - *  required="true" 
  - *  validator=""
  - *  expression="#project.build.directory/generated-sources"
  - *  description=""
  - *
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
    * @version $Id$
  + * @goal bean
  + * @description Goal for generating a plugin descriptor.
  + * @parameter name="mojoScanner"
  + * type="org.apache.maven.tools.plugin.scanner.MojoScanner"
  + * required="true"
  + * validator=""
  + * expression="#component.org.apache.maven.tools.plugin.scanner.MojoScanner"
  + * description="Scanner used to discover mojo descriptors from this project"
  + * @parameter name="project"
  + * type="org.apache.maven.project.MavenProject"
  + * required="true"
  + * validator=""
  + * expression="#project"
  + * description=""
  + * @parameter name="outputDirectory"
  + * type="String"
  + * required="true"
  + * validator=""
  + * expression="#project.build.directory/generated-sources"
  + * description=""
    */
   public class BeanGeneratorMojo
       extends AbstractGeneratorMojo
  
  
  
  1.4       +17 -1     maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
  
  Index: DescriptorGeneratorMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DescriptorGeneratorMojo.java	10 Mar 2005 01:35:25 -0000	1.3
  +++ DescriptorGeneratorMojo.java	22 Mar 2005 13:44:17 -0000	1.4
  @@ -1,5 +1,21 @@
   package org.apache.maven.plugin.plugin;
   
  +/*
  + * Copyright 2001-2005 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.tools.plugin.generator.PluginDescriptorGenerator;
   
  
  
  
  1.7       +36 -27    maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java
  
  Index: JellyGeneratorMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/JellyGeneratorMojo.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JellyGeneratorMojo.java	20 Feb 2005 16:25:20 -0000	1.6
  +++ JellyGeneratorMojo.java	22 Mar 2005 13:44:17 -0000	1.7
  @@ -1,40 +1,49 @@
   package org.apache.maven.plugin.plugin;
   
  +/*
  + * Copyright 2001-2005 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.tools.plugin.generator.jelly.JellyHarnessGenerator;
   
   import java.util.Set;
   
  -
   /**
  - * @goal jelly
  - *
  - * @description Goal for generating a plugin descriptor.
  - *
  - * @parameter
  - *  name="mojoScanner"
  - *  type="org.apache.maven.tools.plugin.scanner.MojoScanner"
  - *  required="true"
  - *  validator=""
  - *  expression="#component.org.apache.maven.tools.plugin.scanner.MojoScanner"
  - *  description="Scanner used to discover mojo descriptors from this project"
  - * @parameter
  - *  name="project"
  - *  type="org.apache.maven.project.MavenProject"
  - *  required="true"
  - *  validator=""
  - *  expression="#project"
  - *  description=""
  - * @parameter
  - *  name="outputDirectory"
  - *  type="String"
  - *  required="true" 
  - *  validator=""
  - *  expression="#project.build.directory/generated-sources"
  - *  description=""
  - *
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
    * @version $Id$
  + * @goal jelly
  + * @description Goal for generating a plugin descriptor.
  + * @parameter name="mojoScanner"
  + * type="org.apache.maven.tools.plugin.scanner.MojoScanner"
  + * required="true"
  + * validator=""
  + * expression="#component.org.apache.maven.tools.plugin.scanner.MojoScanner"
  + * description="Scanner used to discover mojo descriptors from this project"
  + * @parameter name="project"
  + * type="org.apache.maven.project.MavenProject"
  + * required="true"
  + * validator=""
  + * expression="#project"
  + * description=""
  + * @parameter name="outputDirectory"
  + * type="String"
  + * required="true"
  + * validator=""
  + * expression="#project.build.directory/generated-sources"
  + * description=""
    */
   public class JellyGeneratorMojo
       extends AbstractGeneratorMojo
  
  
  

Mime
View raw message