After having generating a website locally, you can deploy it to a webserver.
Before starting, make sure the POM properties
siteDirectory are set correctly.
If you are allowed to access the source of other projects build with Maven
from the same webserver, take a look at their settings.
SSH is a secure protocol which can be used to deploy the website. It is based on the private-public key paradigm. From a private key a public key can be generated, but not the other way around. A private key should be kept safe, but its public key can be shared with anyone. They are used for:
There are several private-public key algorithms, such as RSA.
Maven currently does not contain an SSH client, so you need to install one yourself. Many Linux distributions come with OpenSSH. Windows users can use Cygwin with the optional installation of OpenSSH. Other SSH clients can be found on the net.
Afterwards set the
maven.ssh.executable property properly.
When using OpenSSH through Cygwin, remember to call all maven goals that require SSH
from the Cygwin command line.
Encryption is mostly done behind the scenes, but authentication requires some work.
If your local username doesn't match with your remote username,
maven.username property to set the correct SSH username.
If your administrator doesn't supply you with the private key, you can generate one with most SSH clients. For example to generate an RSA key pair with OpenSSH:
ssh-keygen -t rsa
It asks for a passphrase, which is a long password.
To be able to authenticate you, the remote server needs to have your public key stored. The manner on getting it there depends on your organization's security policy. In some cases the server administrator adds it manually, in other cases you can upload it through a web interface (for example on SourceForge).
If your private key requires a passphrase,
simply calling the
site:sshdeploy goal will cause Maven to hang.
Instead you need to authenticate to the SSH agent before calling Maven.
For example, with the filename being
in the directory
~/.ssh using OpenSSH:
ssh-agent bash ssh-add ~/.ssh/id_rsa cd PROJECT_DIRECTORY maven site:sshdeploy
Note that you need to build the site first.