【发布时间】:2015-06-26 07:19:11
【问题描述】:
我想创建一个 pom.xml,它将从远程 FTP 服务器获取一些 .dmp 文件,
要访问此服务器,我有它的 URL 用户名和密码(当然只有读取权限)。
从服务器获取这些文件的最佳方式是什么?
使用 maven-ant 插件/maven 执行器/ 或任何其他我不知道的插件?
【问题讨论】:
标签: maven maven-plugin pom.xml maven-antrun-plugin
我想创建一个 pom.xml,它将从远程 FTP 服务器获取一些 .dmp 文件,
要访问此服务器,我有它的 URL 用户名和密码(当然只有读取权限)。
从服务器获取这些文件的最佳方式是什么?
使用 maven-ant 插件/maven 执行器/ 或任何其他我不知道的插件?
【问题讨论】:
标签: maven maven-plugin pom.xml maven-antrun-plugin
试试这个
<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>
你也可以看看here
【讨论】: