Maven settings for deployment using scp

Create a file settings.xml in ~/.m2 that’s C:Documents and Settingsiwright.m2 in my case using cygwin on XP

Create a server entry with the necessary info e.g. if using ssh
<servers>
<server>
<id>cggh</id>
<username>iwright</username>
<privateKey>C:Documents and Settingsiwright.sshid_rsa</privateKey>
<passphrase>mypassphrase</passphrase>
<directoryPermissions>775</directoryPermissions>
<filePermissions>664</filePermissions>
</server>
</servers>

Note that if you are using cygwin then you will probably need to copy your .ssh directory from /cygwin/home/username to Documents and Settingusername

Run a deploy command
mvn verify install:install deploy:deploy

If the deployment repository isn’t set in the pom then you can also define it using:
-DaltDeploymentRepository=cggh::default::scp://cloud1.cggh.org/var/www/maven

(Note the id cggh must match the id in settings.xml otherwise the permissions won’t be resolved from the settings.xml)

Leave a Reply

Your email address will not be published. Required fields are marked *