Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

problems with ant ftp task in maven

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm having problems compiling my maven 2.0.6 proj using ant ftp as an anttask. Maven giving me the following error when I try to compile my project.

Embedded error: Could not create task or type of type: ftp.
Ant could not find the task or a class this task relies upon.


I've read quite a few postings related to this problem but I still haven't managed to get this working.

I'm currently running ant 1.6.5 and have copied the following jars to the ant/lib folder: commons-net-1.4.1.jar, jakarta-oro-2.0.8.jar. I'm not having any problems using the ant ftp command building from ANT but in maven it just doesn't work.

Find attached the pom file I'm using

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:artifact="antlib rg.apache.maven.artifact.ant"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mytester</groupId>
<artifactId>MyMavenWeb</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>MyMavenWeb Webapp</name>
<url>http://maven.apache.org</url>;
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>
<echo message="test ftp functionality"/>

<ftp server="ftp.testserver.com"
remotedir="/myfolder"
depends="yes"
userid="tester"
password="1234">
<fileset dir="${basedir}"/>
</ftp>
</tasks>
</configuration>
<!-- Run the ant target -->
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friend,
Does other ant specific tags are working in your maven file.
Are you using Jelly
Like this
xmlns:j="jelly:core"
xmlns:u="jelly:util"
xmlns:ant="jelly:ant">

<ant:ftp> like this?
 
Sven Anderson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply. I'm using <copy file> which works fine. Haven't tried any other tasks yet.

I'm using
<ftp server="ftp.testserver.com"
remotedir="/myfolder"
depends="yes"
userid="tester"
password="1234">

See my pom file above.
Maybe this is the problem.
Should I be using <ant:ftp> instead of just <ftp>

Also, are there any configurations I need to do to maven such as copy jars to maven/lib in order to get this working?

Thanks
Erik
 
Sven Anderson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Just to let everyone know that I fixed the problem.
All I had to do was to add a dependency to ant-commons-net.

 
pie. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic