I am using 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 failed when the folder $ {ftp.server.remotedir} does not exist.
I tried to specify
skipFailedTransfers="true" ignoreNoncriticalErrors="true
but this does not fix the problem and the assembly continues to fail.
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 assembly, don't care about this Ant error, or how to tell Ant not to fail if there is no directory?
Edit:
Peter's decision. If you have 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>
java maven-2 maven-antrun-plugin ant ftp
mickthompson
source share