On Thu, 20 Jan 2005 11:00:51 +0100, Michael Niemaz
<[EMAIL PROTECTED]> wrote:
> Hi all,
>     I'm trying to create my first maven plugin.
>     I've implemented my java beans and the problem I'm facing
>     is interacting with them in the jelly plugin.
>     I get the following error when running 'maven Myupload':
> 
>     BUILD FAILED
>     File...... /home/niemaz/.maven/cache/maven-xxx-plugin-1.45/plugin.jelly
>     Element... sf:ftpBean
>     Line...... 26
>     Column.... 11
>     Property 'files' has no write method
>     Total time: 3 seconds
>     Finished at: Thu Jan 20 10:45:43 CET 2005
> 
>     The trouble seems to reside in the fact that I do not handle files
> properly.
>     What should I give to my Bean files property (List object)?
> 
>     Below is my plugin.jelly code and the Bean source code as well.
> 
> Thanx,
> 
> --mike
> 
> nb: when I get rid of the 'files' field in the 'ftp' tag, it does crash
>     but later ;-) Looks like I'm missing something here ...
> 
>       <define:tag name="ftp">
>         <co:ftpBean
>               site="${site}"
>               destDir="${destDir}"
>               userEmail="${userEmail}"
>               files="${distFileList}"
>         />
>       </define:tag>

> 
>   <goal name="setfiles" description="Build the list of files to upload">
>     <fileScanner var="distFileList">
>       <fileset dir="${maven.dist.dir}">
>         <patternset>
>           <include name="*"/>
>           <exclude name="CHANGES.txt"/>
>         </patternset>
>       </fileset>
>     </fileScanner>

So distFileList is a FileScanner (see
http://jakarta.apache.org/commons/jelly/tag-reference/ant_fileScanner.html
). You have a List as the bean property, and you'll need to convert,
e.g
from a FileScanner you can get an iterator of the files, loop through
and add them to the list, e.g.

<j:useList var="myList" />
<j:forEach items="${distFileList.iterator()}" var="distFile">
    ${myList.add(distFile)}
  </j:forEach>

>   </goal>
> 
>   <goal name="Myupload" description="do the upload to the ftp server">
>     <co:ftp
>       site="${maven.xxx.ftp.site}"
>       destDir="${maven.xxx.ftp.incomingDir}"
>       files="${distFileList}"
>       userEmail="${maven.xxx.userEmail}"
>     />
>   </goal>

And pass ${myList} into the co:ftp tag above as files="${myList}".
-- 
http://www.multitask.com.au/people/dion/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to