I took Tim's suggestion and wrapped the site:ftpdeploy goal in an Ant 1.6.2 script and it works seemelessly with my deployments. Sure, its not what anyone really wants, but it works in the short term for legacy Ant users like me until site:ftpdeploy issues get resolved. Here are some of the specifics of what he mentioned.

1) I defined ANT_HOME to my normal/capable 1.6.2 Ant installation in ~/build.xml. The rest of the properties referenced come from normal Maven locations.

2) I placed the following goal in my main project that all extend

<project>
   <goal name="site:ftpdeploy"
       description="patch for maven's broken site:ftpdeploy">

       <echo>ANT_HOME=${ANT_HOME}</echo>
       <java classname="org.apache.tools.ant.launch.Launcher" fork="true">
           <classpath>
               <fileset dir="${ANT_HOME}" includes="lib/ant-launcher.jar"/>
           </classpath>
           <sysproperty key="ant.home" value="${ANT_HOME}"/>
           <sysproperty key="host" value="${pom.siteAddress}"/>
           <sysproperty key="directory" value="${pom.siteDirectory}"/>
           <sysproperty key="username" value="${maven.username}"/>
           <sysproperty key="password" value="${maven.password}"/>
           <sysproperty key="rootdir" value="${maven.docs.dest}"/>
           <arg value="-f"/>
           <arg value="${user.home}/ftp-build.xml"/>
           <arg value="ftpdeploy"/>
       </java>
   </goal>
</project>

* I placed the following build.xml file in a known location (referenced by the -f flag in the args above). If I knew how to dynamically determine the file location of my parent, I would have placed it next to the maven.xml file.

<project name="coredev-plugins-base">

   <target name="ftpdeploy"
       depends="env"
       description="ftp's the site documents to the public web server">

       <ftp.deploy
           server="${host}"
           userid="${username}"
           password="${password}"
           remotedir="${directory}">
           <files-to-send>
               <fileset dir="${rootdir}"/>
           </files-to-send>
       </ftp.deploy>
   </target>

   <macrodef name="ftp.deploy">
       <attribute name="server"/>
       <attribute name="userid"/>
       <attribute name="password"/>
       <attribute name="remotedir"/>
       <attribute name="passive" default="yes"/>
       <attribute name="binary" default="yes"/>
       <attribute name="verbose" default="yes"/>
       <attribute name="depends" default="yes"/>
       <attribute name="ignoreNoncriticalErrors" default="yes"/>
       <element name="files-to-send" optional="false"/>
       <sequential>
          <ftp action="mkdir"
               server="@{server}"
               userid="@{userid}"
               password="@{password}"
               remotedir="@{remotedir}"
               passive="@{passive}"
               verbose="@{verbose}"
               depends="@{depends}"
               ignoreNoncriticalErrors="@{ignoreNoncriticalErrors}">
          </ftp>
          <ftp server="@{server}"
               userid="@{userid}"
               password="@{password}"
               remotedir="@{remotedir}"
               binary="@{binary}"
               passive="@{passive}"
               verbose="@{verbose}"
               depends="@{depends}"
               ignoreNoncriticalErrors="@{ignoreNoncriticalErrors}">
             <files-to-send/>
          </ftp>
      </sequential>
  </macrodef>
</project>



Tim Stephenson wrote:

I have the same thing!

I investigated a little and it seems to relate to a combination of ant, 
ant-optional and commons-net version issues. The 'silent' failure itself is due 
to the way the ftp task appears to be implemented. Even outside of maven, if no 
connection can be made it does not report any error in many circumstances. I'm 
afraid I did not look into any code but that is the observed behaviour of my 
black box test

The ant-only configuration i got working was: - Ant 1.6.2
- commons-net-1.3.0 (ant documents 1.2.2 is minimum version) - oro 2.0.7 (ant documents that > 2.0.1 should be ok)


I know there was previously a discussion on this list about the Ant version embedded within maven and dont wish to open old wounds but I failed to get ant 1.5.3-1 to exec the ftp task in a variety of combinations external to maven.

In the meantime, my work around was to use an <exec> in my maven xml to call 
ant 1.6.2. Ugly but it works

tim





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



Reply via email to