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

Dennis Lundberg updated MPLUGIN-28:
-----------------------------------

    Description: 
in my pom, i configure maven-plugin-plugin to modify the goalPrefix value as :

...
<groupId>org.codehaus.mojo</groupId>
<artifactId>dashboard-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
...
<build>
...

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>dashboard-report</goalPrefix>
        </configuration>
      </plugin>

</build>

the descriptor of my plugin is ok.

But when i generate the plugin's site, the generated goal in plugin-info.html 
file is "dashboard:dashboard" instead of  "dashboard-report:dashboard".

When i read the code, i see in AbstractGeneratorMojo class :

{code}
/**
 * The goal prefix that will appear before the ":".
 * 
 * @parameter
 */
protected String goalPrefix;
...

public void execute()
    throws MojoExecutionException
{
    if ( !project.getPackaging().equals( "maven-plugin" ) )
    {
        return;
    }

    String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
project.getArtifactId() );
    if ( goalPrefix == null )
    {
        goalPrefix = defaultGoalPrefix;
    }
    else
    {
        getLog().warn( "Goal prefix is: " + goalPrefix + "; Maven currently 
expects it to be " + defaultGoalPrefix );
    }      
{code}


but when i see the PluginReport class :


{code}
protected void executeReport( Locale locale )
    throws MavenReportException
{
    if ( !project.getPackaging().equals( "maven-plugin" ) )
    {
        return;
    }

    String goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
project.getArtifactId() );

    // TODO: could use this more, eg in the writing of the plugin descriptor!
    PluginDescriptor pluginDescriptor = new PluginDescriptor();

    pluginDescriptor.setGroupId( project.getGroupId() );

    pluginDescriptor.setArtifactId( project.getArtifactId() );

    pluginDescriptor.setVersion( project.getVersion() );

    pluginDescriptor.setGoalPrefix( goalPrefix );
{code}


To fix this error :

- add a goal prefix parameter in  the PluginReport class and do the same code 
as AbstractGeneratorMojo class to retreive the goal Prefix

or

- read directly the plugin descriptor which is well generated instead of to 
re-create the plugin descriptor with project parameters




  was:
in my pom, i configure maven-plugin-plugin to modify the goalPrefix value as :

...
<groupId>org.codehaus.mojo</groupId>
<artifactId>dashboard-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
...
<build>
...

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>dashboard-report</goalPrefix>
        </configuration>
      </plugin>

</build>

the descriptor of my plugin is ok.

But when i generate the plugin's site, the generated goal in plugin-info.html 
file is "dashboard:dashboard" instead of  "dashboard-report:dashboard".

When i read the code, i see in AbstractGeneratorMojo class :

...
/**
 * The goal prefix that will appear before the ":".
 * 
 * @parameter
 */
protected String goalPrefix;
...

public void execute()
    throws MojoExecutionException
{
    if ( !project.getPackaging().equals( "maven-plugin" ) )
    {
        return;
    }

    String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
project.getArtifactId() );
    if ( goalPrefix == null )
    {
        goalPrefix = defaultGoalPrefix;
    }
    else
    {
        getLog().warn( "Goal prefix is: " + goalPrefix + "; Maven currently 
expects it to be " + defaultGoalPrefix );
    }      
    
    
    .....


but when i see the PluginReport class :

....

protected void executeReport( Locale locale )
    throws MavenReportException
{
    if ( !project.getPackaging().equals( "maven-plugin" ) )
    {
        return;
    }

    String goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
project.getArtifactId() );

    // TODO: could use this more, eg in the writing of the plugin descriptor!
    PluginDescriptor pluginDescriptor = new PluginDescriptor();

    pluginDescriptor.setGroupId( project.getGroupId() );

    pluginDescriptor.setArtifactId( project.getArtifactId() );

    pluginDescriptor.setVersion( project.getVersion() );

    pluginDescriptor.setGoalPrefix( goalPrefix );


To fix this error :

- add a goal prefix parameter in  the PluginReport class and do the same code 
as AbstractGeneratorMojo class to retreive the goal Prefix

or

- read directly the plugin descriptor which is well generated instead of to 
re-create the plugin descriptor with project parameters





> Error of goal value in Plugin documentation generation
> ------------------------------------------------------
>
>                 Key: MPLUGIN-28
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-28
>             Project: Maven 2.x Plugin Plugin
>          Issue Type: Bug
>         Environment: Maven 2.0.4 / Windows 2000
>            Reporter: David Vicente
>            Priority: Critical
>
> in my pom, i configure maven-plugin-plugin to modify the goalPrefix value as :
> ...
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>dashboard-maven-plugin</artifactId>
> <version>1.0-SNAPSHOT</version>
> ...
> <build>
> ...
> <plugin>
>               <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-plugin-plugin</artifactId>
>         <configuration>
>           <goalPrefix>dashboard-report</goalPrefix>
>         </configuration>
>       </plugin>
> </build>
> the descriptor of my plugin is ok.
> But when i generate the plugin's site, the generated goal in plugin-info.html 
> file is "dashboard:dashboard" instead of  "dashboard-report:dashboard".
> When i read the code, i see in AbstractGeneratorMojo class :
> {code}
> /**
>  * The goal prefix that will appear before the ":".
>  * 
>  * @parameter
>  */
> protected String goalPrefix;
> ...
> public void execute()
>     throws MojoExecutionException
> {
>     if ( !project.getPackaging().equals( "maven-plugin" ) )
>     {
>         return;
>     }
>     String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
> project.getArtifactId() );
>     if ( goalPrefix == null )
>     {
>         goalPrefix = defaultGoalPrefix;
>     }
>     else
>     {
>         getLog().warn( "Goal prefix is: " + goalPrefix + "; Maven currently 
> expects it to be " + defaultGoalPrefix );
>     }      
> {code}
> but when i see the PluginReport class :
> {code}
> protected void executeReport( Locale locale )
>     throws MavenReportException
> {
>     if ( !project.getPackaging().equals( "maven-plugin" ) )
>     {
>         return;
>     }
>     String goalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( 
> project.getArtifactId() );
>     // TODO: could use this more, eg in the writing of the plugin descriptor!
>     PluginDescriptor pluginDescriptor = new PluginDescriptor();
>     pluginDescriptor.setGroupId( project.getGroupId() );
>     pluginDescriptor.setArtifactId( project.getArtifactId() );
>     pluginDescriptor.setVersion( project.getVersion() );
>     pluginDescriptor.setGoalPrefix( goalPrefix );
> {code}
> To fix this error :
> - add a goal prefix parameter in  the PluginReport class and do the same code 
> as AbstractGeneratorMojo class to retreive the goal Prefix
> or
> - read directly the plugin descriptor which is well generated instead of to 
> re-create the plugin descriptor with project parameters

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to