[ 
https://jira.codehaus.org/browse/MPLUGIN-251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Herve Boutemy updated MPLUGIN-251:
----------------------------------

    Description: 
{code:xml}          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>                     
<version>2.4.1</version>
            <executions>
              <execution>
                <id>generated-helpmojo</id>
                <configuration>
                  <extractors>
                    <!-- Use no mojo extractors -->
                    <extractor/>
                  </extractors>
                  <skip>false</skip>
          <skipErrorNoDescriptorsFound>false</skipErrorNoDescriptorsFound>
                  <outputDirectory>C:/tmp</outputDirectory>
                </configuration>
              </execution>
            </executions>
            <dependencies>
                   <dependency>
                    <groupId>bsh</groupId>
                    <artifactId>bsh</artifactId>
                    <version>2.0b1</version>
                   </dependency>
                 <dependency>
                     <groupId>org.objectweb</groupId>
                     <artifactId>asm</artifactId>
                     <version>4.1</version>
                </dependency>
            </dependencies>
          </plugin>{code}

creates org.apache.maven.plugin.idea.HelpMojo.java that looks like:

{code:java}package org.apache.maven.plugin.idea;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;

/**
 * Display help information on maven-idea-plugin.<br/> Call <pre>  mvn 
idea:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter 
details.
 *
 * @version generated on Wed Sep 25 21:55:32 EDT 2013
 * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 
2.9)
 * @goal help
 * @requiresProject false
 * @threadSafe
 */
public class HelpMojo
    extends AbstractMojo
{
    /**
     * If <code>true</code>, display all settable properties for each goal.
     *
     * @parameter expression="${detail}" default-value="false"
     */
    private boolean detail;

    /**
     * The name of the goal for which to show help. If unspecified, all goals 
will be displayed.
     *
     * @parameter expression="${goal}"
     */
    private java.lang.String goal;

    /**
     * The maximum length of a display line, should be positive.
     *
     * @parameter expression="${lineLength}" default-value="80"
     */
    private int lineLength;

    /**
     * The number of spaces per indentation level, should be positive.
     *
     * @parameter expression="${indentSize}" default-value="2"
     */
    private int indentSize;


    /** {@inheritDoc} */
    public void execute()
        throws MojoExecutionException
    {
        if ( lineLength <= 0 )
        {
            getLog().warn( "The parameter 'lineLength' should be positive, 
using '80' as default." );
            lineLength = 80;
        }
        if ( indentSize <= 0 )
        {
            getLog().warn( "The parameter 'indentSize' should be positive, 
using '2' as default." );
            indentSize = 2;
        }

        StringBuffer sb = new StringBuffer();

        append( sb, "org.apache.maven.plugins:maven-idea-plugin:2.2", 0 );
        append( sb, "", 0 );

        append( sb, "Maven IDEA Plugin", 0 );{code}

//needs the 2 closing braces!


  was:
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>                     
<version>2.4.1</version>
            <executions>
              <execution>
                <id>generated-helpmojo</id>
                <configuration>
                  <extractors>
                    <!-- Use no mojo extractors -->
                    <extractor/>
                  </extractors>
                  <skip>false</skip>
          <skipErrorNoDescriptorsFound>false</skipErrorNoDescriptorsFound>
                  <outputDirectory>C:/tmp</outputDirectory>
                </configuration>
              </execution>
            </executions>
            <dependencies>
                   <dependency>
                    <groupId>bsh</groupId>
                    <artifactId>bsh</artifactId>
                    <version>2.0b1</version>
                   </dependency>
                 <dependency>
                     <groupId>org.objectweb</groupId>
                     <artifactId>asm</artifactId>
                     <version>4.1</version>
                </dependency>
            </dependencies>
          </plugin>

creates org.apache.maven.plugin.idea.HelpMojo.java that looks like:

package org.apache.maven.plugin.idea;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;

/**
 * Display help information on maven-idea-plugin.<br/> Call <pre>  mvn 
idea:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter 
details.
 *
 * @version generated on Wed Sep 25 21:55:32 EDT 2013
 * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator (version 
2.9)
 * @goal help
 * @requiresProject false
 * @threadSafe
 */
public class HelpMojo
    extends AbstractMojo
{
    /**
     * If <code>true</code>, display all settable properties for each goal.
     *
     * @parameter expression="${detail}" default-value="false"
     */
    private boolean detail;

    /**
     * The name of the goal for which to show help. If unspecified, all goals 
will be displayed.
     *
     * @parameter expression="${goal}"
     */
    private java.lang.String goal;

    /**
     * The maximum length of a display line, should be positive.
     *
     * @parameter expression="${lineLength}" default-value="80"
     */
    private int lineLength;

    /**
     * The number of spaces per indentation level, should be positive.
     *
     * @parameter expression="${indentSize}" default-value="2"
     */
    private int indentSize;


    /** {@inheritDoc} */
    public void execute()
        throws MojoExecutionException
    {
        if ( lineLength <= 0 )
        {
            getLog().warn( "The parameter 'lineLength' should be positive, 
using '80' as default." );
            lineLength = 80;
        }
        if ( indentSize <= 0 )
        {
            getLog().warn( "The parameter 'indentSize' should be positive, 
using '2' as default." );
            indentSize = 2;
        }

        StringBuffer sb = new StringBuffer();

        append( sb, "org.apache.maven.plugins:maven-idea-plugin:2.2", 0 );
        append( sb, "", 0 );

        append( sb, "Maven IDEA Plugin", 0 );

//needs the 2 closing braces!



> AbstractGeneratorMojo, HelpMojo doesnt create properly formatted HelpMojo
> -------------------------------------------------------------------------
>
>                 Key: MPLUGIN-251
>                 URL: https://jira.codehaus.org/browse/MPLUGIN-251
>             Project: Maven Plugin Tools
>          Issue Type: Bug
>          Components: Plugin Plugin
>    Affects Versions: 2.9
>         Environment: JDK 1.7
> Maven 3.0.2
>            Reporter: Martin Gainty
>
> {code:xml}          <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-plugin-plugin</artifactId>                     
> <version>2.4.1</version>
>             <executions>
>               <execution>
>                 <id>generated-helpmojo</id>
>                 <configuration>
>                   <extractors>
>                     <!-- Use no mojo extractors -->
>                     <extractor/>
>                   </extractors>
>                   <skip>false</skip>
>           <skipErrorNoDescriptorsFound>false</skipErrorNoDescriptorsFound>
>                   <outputDirectory>C:/tmp</outputDirectory>
>                 </configuration>
>               </execution>
>             </executions>
>             <dependencies>
>                    <dependency>
>                   <groupId>bsh</groupId>
>                   <artifactId>bsh</artifactId>
>                   <version>2.0b1</version>
>                  </dependency>
>                  <dependency>
>                    <groupId>org.objectweb</groupId>
>                    <artifactId>asm</artifactId>
>                    <version>4.1</version>
>               </dependency>
>           </dependencies>
>           </plugin>{code}
> creates org.apache.maven.plugin.idea.HelpMojo.java that looks like:
> {code:java}package org.apache.maven.plugin.idea;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
> import org.apache.maven.plugin.AbstractMojo;
> import org.apache.maven.plugin.MojoExecutionException;
> /**
>  * Display help information on maven-idea-plugin.<br/> Call <pre>  mvn 
> idea:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</pre> to display parameter 
> details.
>  *
>  * @version generated on Wed Sep 25 21:55:32 EDT 2013
>  * @author org.apache.maven.tools.plugin.generator.PluginHelpGenerator 
> (version 2.9)
>  * @goal help
>  * @requiresProject false
>  * @threadSafe
>  */
> public class HelpMojo
>     extends AbstractMojo
> {
>     /**
>      * If <code>true</code>, display all settable properties for each goal.
>      *
>      * @parameter expression="${detail}" default-value="false"
>      */
>     private boolean detail;
>     /**
>      * The name of the goal for which to show help. If unspecified, all goals 
> will be displayed.
>      *
>      * @parameter expression="${goal}"
>      */
>     private java.lang.String goal;
>     /**
>      * The maximum length of a display line, should be positive.
>      *
>      * @parameter expression="${lineLength}" default-value="80"
>      */
>     private int lineLength;
>     /**
>      * The number of spaces per indentation level, should be positive.
>      *
>      * @parameter expression="${indentSize}" default-value="2"
>      */
>     private int indentSize;
>     /** {@inheritDoc} */
>     public void execute()
>         throws MojoExecutionException
>     {
>         if ( lineLength <= 0 )
>         {
>             getLog().warn( "The parameter 'lineLength' should be positive, 
> using '80' as default." );
>             lineLength = 80;
>         }
>         if ( indentSize <= 0 )
>         {
>             getLog().warn( "The parameter 'indentSize' should be positive, 
> using '2' as default." );
>             indentSize = 2;
>         }
>         StringBuffer sb = new StringBuffer();
>         append( sb, "org.apache.maven.plugins:maven-idea-plugin:2.2", 0 );
>         append( sb, "", 0 );
>         append( sb, "Maven IDEA Plugin", 0 );{code}
> //needs the 2 closing braces!



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to