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
<privateKey>C:Documents and Settingsiwright.sshid_rsa</privateKey>

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:

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

Using Roo on an existing database

Creating a web application to update an existing database with Roo is extremely simple…

project –topLevelPackage org.cggh.quac –projectName quac –java 6
persistence setup –provider HIBERNATE –database MYSQL –databaseName drupal_users –userName drupal6 –password drupal6
database introspect –schema drupal_users
database reverse engineer –package ~.model –schema drupal_users
controller all –package ~.web

Some notes:
Make sure that the database has foreign keys set up
If you want security then run:
security setup

For password encoding:
Add the following to src/main/resources/META-INF/spring/applicationContext.xml
<bean id=”passwordEncoder” class=””>
<constructor-arg value=”MD5″ />

Add the following to the Users class:
transient private MessageDigestPasswordEncoder passwordEncoder;

private String pass;

public void setPass(String password) {
if(password==null||password.equals(“”)) {
return; //don’t update password if blank is sent
String encodedPassword = passwordEncoder.encodePassword(password, null);
this.pass = encodedPassword;