You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by cowwoc <co...@bbs.darktech.org> on 2011/01/27 20:38:51 UTC

@parameter alias does not seem to work

Hi,

Did I misunderstand how @parameter alias is supposed to work, or is this a
legitimate bug?

My plugin contains:

	/**
	 * The environment variables.
	 *
	 * @parameter alias="environment"
	 * @required
	 */
	@SuppressWarnings("UWF_UNWRITTEN_FIELD")
	private Map<String, String> environmentVariables;

The referencing POM contains:

<configuration>
  <environment>
    <FOO>bar</FOO>
  </environment>
</configuration>

This fails, as does:

<configuration>
  <environmentVariables>
    <FOO>bar</FOO>
  </environmentVariables>
</configuration>

but if I remove "alias" from the plugin and use the second POM variation
then it works. What am I doing wrong?

Thanks,
Gili
-- 
View this message in context: http://maven.40175.n5.nabble.com/parameter-alias-does-not-seem-to-work-tp3360329p3360329.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: @parameter alias does not seem to work

Posted by cowwoc <co...@bbs.darktech.org>.

cowwoc wrote:
> 
> Hi,
> 
> Did I misunderstand how @parameter alias is supposed to work, or is this a
> legitimate bug?
> 
> My plugin contains:
> 
> 	/**
> 	 * The environment variables.
> 	 *
> 	 * @parameter alias="environment"
> 	 * @required
> 	 */
> 	@SuppressWarnings("UWF_UNWRITTEN_FIELD")
> 	private Map<String, String> environmentVariables;
> 
> The referencing POM contains:
> 
> <configuration>
>   <environment>
>     <FOO>bar</FOO>
>   </environment>
> </configuration>
> 
> This fails, as does:
> 
> <configuration>
>   <environmentVariables>
>     <FOO>bar</FOO>
>   </environmentVariables>
> </configuration>
> 
> but if I remove "alias" from the plugin and use the second POM variation
> then it works. What am I doing wrong?
> 
> Thanks,
> Gili
> 


I think this is a bug. Aliasing seems to work for simple types (String) but
not for Map. Can someone please confirm this on their end?

Gili
-- 
View this message in context: http://maven.40175.n5.nabble.com/parameter-alias-does-not-seem-to-work-tp3360329p3360359.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org