如何使用maven从ftp服务器下载文件?
我想创建一个pom.xml,它将从远程FTP服务器获取一些.dmp文件 要访问这个服务器,我有它的URL用户名和密码(当然,谁只有读取权限) 从服务器获取这些文件的最佳方式是什么 使用maven ant插件/maven executer/或我不知道的任何其他插件?试试这个如何使用maven从ftp服务器下载文件?,maven,maven-plugin,pom.xml,maven-antrun-plugin,Maven,Maven Plugin,Pom.xml,Maven Antrun Plugin,我想创建一个pom.xml,它将从远程FTP服务器获取一些.dmp文件 要访问这个服务器,我有它的URL用户名和密码(当然,谁只有读取权限) 从服务器获取这些文件的最佳方式是什么 使用maven ant插件/maven executer/或我不知道的任何其他插件?试试这个 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-a
<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>
org.apache.maven.plugins
它起作用了,但由于某种原因,它无法获取.dmp文件。txt文件正在被提取。请检查.dmp文件的路径,看看它是否与上面的include name表达式匹配。如果不匹配,则必须相应地更改它。还可以查看我在上面发布的链接,都已经检查过了。它并没有给我一个错误,只是似乎被卡住了(可能与文件大小有关)