maven deployment with ftp uploading: I want to upload just the war file but is uploading more files

妖精的绣舞 提交于 2019-12-06 01:41:04

wagon-plugins are for deploying artifacts to repositories, repositories need all those other files to function. If you are trying to ftp your .war file to a server for deployment, then use the correct plugin for your server, not the wagon-plugin.

The documentation for that plug starts off with

In order to deploy artifacts using FTP ...

mvn deploy is for deploying artifacts to a repository, thus all the other files that are needed for the repository to function are uploaded as well.

Use Ant and it's FTP task in order to upload generated war file.

With antrun plugin you can execute your ant script like that:

 <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>

Use property in order to define some property like file name/path to ant script. All maven's properties are accessible in ant script too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!