Tutorials‎ > ‎

Spring Roo


Spring roo tutorial


Download and unzip spring-roo-1.2.0 from http://s3.amazonaws.com/dist.springframework.org/release/ROO/spring-roo-1.2.0.RELEASE.zip

NOTE: Read through the spring-roo-1.2.0.RELEASE\docs\pdf\spring-roo-docs.pdf







Enter the spring-roo-1.2.0.RELEASE\bin path into the PATH variable of the system environment



Open up a command prompt and check if roo is working fine




Change to a test directory where you want to build this project



project --topLevelPackage com.myp.rootest


jpa setup --database MYSQL --provider HIBERNATE --hostName localhost --userName root --password password --databaseName rootest



Introspect & revere engineer

Now you need to introspect the existing DB and reverse engineer the db tables .

You may end up with the following problem

roo> database introspect --schema no-schema-required

Spring Roo automatic add-on discovery service currently unavailable

JDBC driver not available for 'com.mysql.jdbc.Driver'

roo>

The solution is to execute the following

osgi  start --url file:///C:/Users<your folder>/repository/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar

or the path to mysql connector jar file.

And then the following

database introspect --schema no-schema-required

reverse engineer the db now ,

database reverse engineer --schema rootest  --excludeTables jbpm4_* --package ~.domain


web mvc setup

web mvc all --package ~.web

perform package

summary


project --topLevelPackage com.myp.rootest

jpa setup --database MYSQL --provider HIBERNATE --hostName localhost --userName root --password password --databaseName rootest

database introspect --schema no-schema-required

database reverse engineer --schema rootest --excludeTables jbpm4_* --package ~.domain

web mvc setup

web mvc all --package ~.web

perform package

exit

mvn tomcat:run


then go to http://localhost:8080/rootest


changes and updates to the existing project – how to


if the database has changed or updated as in Update or alter the schema, then you need to run spring roo DBRE again and build the project.

database reverse engineer --schema rootest --excludeTables jbpm4_* --package ~.domain



Run perform package again to update the files .


Refreshing the changes in STS IDE

Do a projectàclean and restart the tomcat server.


import project to spring STS IDE



Import as existing maven project




Comments