'How to deploy a maven web application in ftp?

I am building a web project using spring framework and maven. I want to deploy it using ftp. For this I have included the apache weagon :

<distributionManagement>
        <repository>
            <id>ftp-repository</id>
            <url>ftp://ftp.xxxxx.com</url>  
        </repository>
     </distributionManagement>

    <build>
        <!-- FTP TRANSFER -->
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ftp</artifactId>
                <version>1.0-beta-5</version>
            </extension>
        </extensions>

and I have also created a file settings.xml

<settings>
  <servers>
    <server>
        <id>ftp-repository</id>
        <username>user</username>
        <password>pass</password>
    </server>
  </servers>
</settings>

But when I execute mvn deploy I get the following error: Authentication failed, Password not specified for the repository ftp-repository.

Is this the correct way to deploy an app? What else should I do to deploy it successfully?



Solution 1:[1]

For completeness sake, I have had this issue when i tried to connect to an sftp server using the default ftp 'wagon'. When I changed the artefactId to wagon-ssh (also see this link) the messages started to make more sense.

In other words; the error message is not very helpful in this particiular case.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 keesp