3

I am following instructions exactly as specified here:

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

(The only difference is that I'm using version 2.4 of wagon-ftp).

and then execute

mvn deploy

I just want to upload a single war file, however it uploads several other files, with pom, md5, sha1 extensions and buries them under one of my source directories.

I've been trying to look for the appropriate configuration to modify this behaviour with no luck yet.

DPM
  • 1,960
  • 3
  • 26
  • 49

2 Answers2

5

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.

vadchen
  • 1,442
  • 1
  • 11
  • 14
  • 1
    I appreciate your answer, this is why I ended up using, although I didn't create an an "ant" task in the target, but just defined the "ftp" parameters and created a taskdef. I don't know why you've been voted down. It's a valid solution. – DPM Apr 08 '13 at 19:24
2

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.