I'm using the FTP Ant task with maven-antrun-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>ftp</id>
<phase>generate-resources</phase>
<configuration>
<tasks>
<ftp action="get"
server="${ftp.server.ip}"
userid="${ftp.server.userid}"
password="${ftp.server.password}"
remotedir="${ftp.server.remotedir}"
depends="yes" verbose="yes"
skipFailedTransfers="true"
ignoreNoncriticalErrors="true">
<fileset dir="target/test-classes/testdata">
<include name="**/*.html" />
</fileset>
</ftp>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
...
the problem is that my build fails when the folder ${ftp.server.remotedir} doesn't exist.
I tried to specify
skipFailedTransfers="true"
ignoreNoncriticalErrors="true
but these don't fix the problem and the build keeps failing.
An Ant BuildException has occured: could not change remote directory: 550 /myBadDir: The system cannot find the file specified.
Do you know how to instruct my maven build to don't care about this Ant task error / or how to instruct Ant to don't fail in the case of a missing directory?
Edit:
Peter's solution works.
If you a problem like
[INFO] Error configuring: org.apache.maven.plugins:maven-antrun-plugin. Reason: java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.close(Ljava/io/InputStream;)V
Just exclude ant from ant-contrib
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>${ant-contrib.ver}</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>