我们尝试过使用ant ftp任务,但无法使其正常工作,如下所示:
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>ftp</id>
<phase>generate-resources</phase>
<configuration>
<target>
<ftp action="get" server="192.168.168.xxx" userid="anonymous"
password="anonymous">
<fileset dir="Folder/tools/toolX">
<include name="**/*.*" />
</fileset>
</ftp>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
....
提前感谢!
maven-antrun插件仅为ant运行时提供基本任务集。对于其他任务,您需要将它们作为依赖项提供(如果需要,还需要它们的依赖项)。"ftp"案例在maven的网站上被用作这个问题的一个例子,你可以在那里找到完整的例子:http://maven.apache.org/plugins/maven-antrun-plugin/examples/customTasks.html
工作完美!
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<configuration>
<target>
<ftp action="get"
server="192.168.1.1"
remotedir="remoteDir"
userid="anonymous"
password="anonymous">
<fileset dir="${project.build.directory}">
<include name="**/*.*"/>
</fileset>
</ftp>
</target>
</configuration>
<dependencies>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>