You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Geoffrey De Smet <ge...@gmail.com> on 2007/05/02 17:17:05 UTC

array (or collecton) as a default-value of a mojo configuration parameter

In a Mojo I use the following annotation:

     /**
      * @parameter default-value="${basedir}/src/daisy/schema.xml"
      */
     private File[] daisySchemas;

This doesn't work, as the default-value is turned into a class of 
String, and it needs an array of File's (an array of Strings would also 
be acceptable). The default value is an array with a single value.

I've tried combinations like:
   default-value="{${basedir}/src/daisy/schema.xml}"
   default-value="[${basedir}/src/daisy/schema.xml]"
   default-value="${basedir}/src/daisy/schema.xml,"
but each time it's not the correct literal for a single value array,
so what is?

Thanks

-- 
With kind regards,
Geoffrey De Smet


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


Re: array (or collecton) as a default-value of a mojo configuration parameter

Posted by Roland Asmann <Ro...@cfc.at>.
I believe it is not possible to define a Collection or array on plugins (at 
least not as parameters), although I could be wrong.

A solution to your problem could be to input a String with the filename(s), 
making it comma-separated (or some other identifier which you like). 
Obviously you'd have to create the array of files yourself from the list of 
file-names, but at least this works.


On Wednesday 02 May 2007 17:17, Geoffrey De Smet wrote:
> In a Mojo I use the following annotation:
>
>      /**
>       * @parameter default-value="${basedir}/src/daisy/schema.xml"
>       */
>      private File[] daisySchemas;
>
> This doesn't work, as the default-value is turned into a class of
> String, and it needs an array of File's (an array of Strings would also
> be acceptable). The default value is an array with a single value.
>
> I've tried combinations like:
>    default-value="{${basedir}/src/daisy/schema.xml}"
>    default-value="[${basedir}/src/daisy/schema.xml]"
>    default-value="${basedir}/src/daisy/schema.xml,"
> but each time it's not the correct literal for a single value array,
> so what is?
>
> Thanks

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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