You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2008/02/20 00:58:28 UTC

[jira] Updated: (MPLUGIN-48) Required parameters of self written Mojo configured in execution part of POM are ignored and causing error

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

Dennis Lundberg updated MPLUGIN-48:
-----------------------------------

    Description: 
Required parameters configured in execution part of POM are ignored if:

 the parameter ist set as required AND
 (no default value is set OR
  default-Value is set to "") AND
 configuration of parameter values are done in the execution element.

Example:

Parameter definition in Mojo:

{code}
	/** 
	 * @parameter  default-value="ATTENTION DEFAULT"
	 * @required
	 */	
	private File dummy1;
{code}

and snip from POM:

{code:xml}
    <plugins>
      <plugin>
        <groupId>myownartifact.plugin</groupId>
        <artifactId>maven-myownartifact-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
             <id>extract</id>
             <configuration>
              <dummy1>c:/my files/test/dummy1</dummy1>
             </configuration>
             <goals>
               <goal>extract</goal>
             </goals>
          </execution>
        </executions>
      </plugin>     
    </plugins>
{code}

runs fine.

If I change the definition of the parameter to

{code}
	/** 
	 * @parameter 
	 * @required
	 */	
	private File dummy1;
{code}

or 
{code}
      * @parameter default-value=""
{code}

then I got an error:

[0] inside the definition for plugin: 'maven-myownartifact-plugin'specify the following:

<configuration>
  ...
  <dummy2>VALUE</dummy2>
</configuration>.

In my opinion this is a bug because with @required I have already tagged this parameter as mandatory. So I'm already forced to configure it.

BTW, if I configure the parameters outside the execution element evrything works fine as expected!

More info:
- the plugin is bind to the package phase

If a runable example is needed  it's possible to provide one.

  was:
Required parameters configured in execution part of POM are ignored if:

 the parameter ist set as required AND
 (no default value is set OR
  default-Value is set to "") AND
 configuration of parameter values are done in the execution element.

Example:

Parameter definition in Mojo:

	/** 
	 * @parameter  default-value="ATTENTION DEFAULT"
	 * @required
	 */	
	private File dummy1;

and snip from POM:

    <plugins>
      <plugin>
        <groupId>myownartifact.plugin</groupId>
        <artifactId>maven-myownartifact-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
             <id>extract</id>
             <configuration>
              <dummy1>c:/my files/test/dummy1</dummy1>
             </configuration>
             <goals>
               <goal>extract</goal>
             </goals>
          </execution>
        </executions>
      </plugin>     
    </plugins>

runs fine.

If I change the definition of the parameter to

	/** 
	 * @parameter 
	 * @required
	 */	
	private File dummy1;

or 
      * @parameter default-value=""

then I got an error:

[0] inside the definition for plugin: 'maven-myownartifact-plugin'specify the following:

<configuration>
  ...
  <dummy2>VALUE</dummy2>
</configuration>.

In my opinion this is a bug because with @required I have already tagged this parameter as mandatory. So I'm already forced to configure it.

BTW, if I configure the parameters outside the execution element evrything works fine as expected!

More info:
- the plugin is bind to the package phase

If a runable example is needed  it's possible to provide one.


> Required parameters of self written Mojo configured in execution part of POM are ignored and causing error
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: MPLUGIN-48
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-48
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Bug
>         Environment: Windows XP
>            Reporter: Halil-Cem Gürsoy
>
> Required parameters configured in execution part of POM are ignored if:
>  the parameter ist set as required AND
>  (no default value is set OR
>   default-Value is set to "") AND
>  configuration of parameter values are done in the execution element.
> Example:
> Parameter definition in Mojo:
> {code}
> 	/** 
> 	 * @parameter  default-value="ATTENTION DEFAULT"
> 	 * @required
> 	 */	
> 	private File dummy1;
> {code}
> and snip from POM:
> {code:xml}
>     <plugins>
>       <plugin>
>         <groupId>myownartifact.plugin</groupId>
>         <artifactId>maven-myownartifact-plugin</artifactId>
>         <extensions>true</extensions>
>         <executions>
>           <execution>
>              <id>extract</id>
>              <configuration>
>               <dummy1>c:/my files/test/dummy1</dummy1>
>              </configuration>
>              <goals>
>                <goal>extract</goal>
>              </goals>
>           </execution>
>         </executions>
>       </plugin>     
>     </plugins>
> {code}
> runs fine.
> If I change the definition of the parameter to
> {code}
> 	/** 
> 	 * @parameter 
> 	 * @required
> 	 */	
> 	private File dummy1;
> {code}
> or 
> {code}
>       * @parameter default-value=""
> {code}
> then I got an error:
> [0] inside the definition for plugin: 'maven-myownartifact-plugin'specify the following:
> <configuration>
>   ...
>   <dummy2>VALUE</dummy2>
> </configuration>.
> In my opinion this is a bug because with @required I have already tagged this parameter as mandatory. So I'm already forced to configure it.
> BTW, if I configure the parameters outside the execution element evrything works fine as expected!
> More info:
> - the plugin is bind to the package phase
> If a runable example is needed  it's possible to provide one.

-- 
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