maven-antrun-pluginでFTPAntタスクを使用しています
<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>
...
問題は、フォルダー${ftp.server.remotedir}が存在しない場合にビルドが失敗することです。
指定してみました
skipFailedTransfers="true"
ignoreNoncriticalErrors="true
しかし、これらは問題を修正せず、ビルドは失敗し続けます。
An Ant BuildException has occured: could not change remote directory: 550 /myBadDir: The system cannot find the file specified.
このAntタスクエラーを気にしないようにMavenビルドに指示する方法/またはディレクトリが見つからない場合に失敗しないようにAntに指示する方法を知っていますか?
編集:
ピーターのソリューションは機能します。
あなたのような問題の場合
[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
ant-contribからantを除外するだけです
<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>