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

-------------------------------------------------------------------------------
<project xmlns:define="jelly:define"
xmlns:j="jelly:core"
xmlns:x="jelly:xml" xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven"
xmlns:util="jelly:util"
xmlns:velocity="jelly:velocity"
xmlns:co="co"
>


  <define:taglib uri="co">
     <define:jellybean
       name="ftpBean"
       className="xxx.xxx.xxx.xxx.XXXBean"
       method="execute">
     </define:jellybean>

     <define:tag name="ftp">
       <co:ftpBean
             site="${site}"
             destDir="${destDir}"
             userEmail="${userEmail}"
             files="${distFileList}"
       />
     </define:tag>
 </define:taglib>

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

 <goal name="Mydeploy" description="Deploy the distribution">
   <attainGoal name="Myinit"/>
   <attainGoal name="setfiles"/>
   <attainGoal name="Myupload"/>
 </goal>
------------------------------------------------------------------------------------------------
package net.codex.mavenplugins.codex;

public class FTPBean {
   private String _site;
   private String _destDir;
   private List _files;
   private String _userEmail;

   /**
    * Constructor for FTPBean
    */
   public FTPBean() {
       super();
       System.out.println("new FTPBean");
   }

   /**
    * Gets the site.
    * @return the site.
    */
   public String getSite() {
       System.out.println("getSite " + _site);
       return _site;
   }

   /**
    * Sets the site.
    * @param site The site to set.
    */
   public void setSite(String site) {
       System.out.println("setSite " + site);
       _site = site;
   }

   /**
    * Gets the destDir.
    * @return the destDir.
    */
   public String getDestDir() {
       System.out.println("getDestDir " + _destDir);
       return _destDir;
   }

   /**
    * Sets the destDir.
    * @param destDir The destDir to set.
    */
   public void setDestDir(String destDir) {
       System.out.println("setDestDir " + destDir);
       _destDir = destDir;
   }

   /**
    * Gets the files.
    * @return the files.
    */
   public List getFiles() {
       System.out.println("getFiles " + _files.size());
       return _files;
   }

/**
* Sets the files.
* @param files The files to set.
*/
public void setFiles(List files) {
System.out.println("setFiles " + files.size());
_files = files;
}
/**
* Gets the userEmail.
* @return the userEmail.
*/
public String getUserEmail() {
System.out.println("getUserEmail " + _userEmail);
return _userEmail;
}


   /**
    * Sets the userEmail.
    * @param userEmail The userEmail to set.
    */
   public void setUserEmail(String userEmail) {
       System.out.println("setUserEmail " + userEmail);
       _userEmail = userEmail;
   }
}

Reply via email to