What does it do when it doesn't work?

For me, the -X switch showed that there was a CNF exception for an oro
FTP class. I had to put this in my project.xml:

    <dependency>
      <groupId>ant-contrib</groupId>
      <artifactId>ant-contrib</artifactId>
      <version>20020829</version>
    </dependency>
    <dependency>
      <groupId>oro</groupId>
      <artifactId>NetComponents</artifactId>
      <version>xxx</version>
      <properties>
        <classloader>root</classloader>
      </properties>
    </dependency>

The NetComponents JAR file is not at ibiblio, so I added it to our
company repo. The version 'xxx' I just added because there was no
version number associated with the JAR file.

In retrospect, the ant-contrib part may not be required. It looks like
the Ant FTP class is loaded automatically by Maven from
ant-optional-1.5.3-1.jar. I had to add the <classloader> property
because it looked like Ant's FTP class was loaded in the root
classloader, but the NetComponents JAR was loaded by the Maven
classloader. I know the <classloader> is deprecated, but I wasn't sure
how else to get it to work.

I did this in a plugin, so I added this to my plugin.jelly:

  <ant:taskdef name="ftp"
           classname="org.apache.tools.ant.taskdefs.optional.net.FTP">
    <ant:classpath>
      <ant:pathelement path="${plugin.getDependencyPath('ant-contrib:ant-contrib')}"/>
      <ant:pathelement path="${plugin.getDependencyPath('oro:NetComponents')}"/>
      <ant:path refid="maven.dependency.classpath"/>
    </ant:classpath>
  </ant:taskdef>

before invoking the "ftp" task. For a maven.xml file, you wouldn't use
${plugin}. I think you'd use ${context}, but I'm not positive.

Again, you may be able to drop the whole ant-contrib part.

  Jeff

On Mon, 09 Aug 2004, at 12:40:51 [GMT +0200] Jesper Linvald wrote:

> Hello all,

> I am trying to use the ftp ant task from maven. It dosent work! Running 
> the task straight from Ant works fine....

> Some have suggested a brute hack with a typedef and dependency on Ant 1.6.

> Before trying this I would like to hear if anybody has a solution to the 
> problem or another way to use ftp or scp?

> Regards

> Jesper Linvald
> MAERSK DATA TRANSPORT
> Tel no.: +45 3911 1891
> e-mail: [EMAIL PROTECTED]

-- 
mailto:[EMAIL PROTECTED]



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

Reply via email to