使用ftp上传的maven部署:我只想上传war文件,但是上传的文件更多

DPM*_*DPM 3 ftp pom.xml maven maven-wagon-plugin

我完全遵循这里指定的指示:

http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

(唯一的区别是我使用的是版本2.4的wagon-ftp).

然后执行

mvn部署

我只想上传一个war文件,但它上传了几个其他文件,使用pom,md5,sha1扩展名并将它们隐藏在我的一个源目录下.

我一直在尝试寻找适当的配置来修改这种行为,但没有运气.

vad*_*hen 5

使用Ant及其FTP任务来上传生成的war文件.

使用antrun插件,你可以执行你的蚂蚁脚本:

 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-antrun-plugin</artifactId>
   <version>1.7</version>
   <configuration>
     <target>
        <property name="file_name" value="${project.build.finalName}.war" />
        <ant antfile="${basedir}/build.xml">
           <target name="war upload" />
        </ant>
     </target>
   </configuration>
 </plugin>
Run Code Online (Sandbox Code Playgroud)

使用property以定义类似的文件名/路径ant脚本某些属性.所有maven的属性也可以在ant脚本中访问.