IT, Scala, Java, Web, Ubuntu

The end of the last month Spring Source released Spring ROO in alpha stage. My friend, Dr. Stefan Schmidt, who in fact used to teach me J2EE technology at UTS when I was a UTS student, has been working for Spring Source and is now involved in ROO development. Although ROO sounds really like Australian, it signifies Real Object-Oriented (ROO). After the release of the alpha version, Dr. Schmidt posted an introductory tutorial of ROO on his blog. He explained well so I could easily try this new mind-blowing technology.

-Extract spring-roo-1.0.0.A2.zip file to /somepath/roo-1.0.0.A2
-Add the environment variable ROO_HOME with the path of Roo home in the .bashrc file.
-Add $ROO_HOME/bin to PATH in the .bashrc file.
e.g.)

Instead of following the script that Dr. Schmidt provided, I just used vote.roo which can be found in the samples directory. Well no special reasons, it just looks simpler. That’s it. If you are seeking more interesting one, you’d better try the one on the blog of Dr. Schmidt and then try your own one. ^O^

-In order to import the ROO project, just created, to Eclipse (STS), run maven2’s eclipse plug-in.

-Now run Eclipse. Since ROO is a part of Spring Framework, I’m using SpringSource Tool Suite (STS) for this practice.

SpringSource Tool Suite

Well, before I go further, here are what I am using.
*SpringSource Tool Suite (STS) 2.0.0

Apart from all the Spring related plug-ins that STS comes with, it also comes with several good plug-ins such as AspectJ Development Tools (AJDT), PMD for Eclipse (Java source code analyser) and EclEmma (Code Coverage Tool) which are what I usually install when I use pure Eclipse JEE.

*Eclipse Plug-ins

Subclipse

Maven Integration for Eclipse (M2Eclipse)

Aptana

JDepend (Java source code analyser)

Copy Fully Qualified Class Name Plugin

Resource Bundle Editor

and of course Spring ROO Integration for Eclipse (I heard a new STS will include it).

However, what are really required for this ROO practice are Eclipse JEE, Spring IDE, AJDT, M2Eclipse and Spring ROO Integration. Or you can simply use STS and install M2Eclipse and Spring ROO Integration. If you use Eclipse JEE Ganymede and install Spring IDE, it will automatically install AJDT as a dependency of Spring IDE since Ganymede has a smart software & add-ons update manager.

Expand the General entry -> Select Existing Projects into Workspace -> Click the Next button.

Select Project to Import

Browse the roo project directory created by roo. In my case it’s roo_test -> Click the Finish button.
(NOTE: Because I created the roo project directory inside the workspace of Eclipse (STS), I don’t need to check Copy projects into workspace option.)

Turn AJDT's Weaving Service on

If Eclipse asks to turn on weaving service function of AJDT, Click the Yes button.

Restart STS (Eclipse)

Restart Eclipse.

Dependency Problems

Eclipse is restarted and there are errors in the project as the require dependencies are not in the project directory.

So now, let M2Eclipse resolves this dependency problem. That’s why I’m using this plug-in. I want to focus on real problems in software development rather than focusing on providing dependency libraries for development.

Let M2Eclipse Resolves Dependencies

Right click on the project -> Select the Maven option on the menu -> Select the Enable Dependency Management.
Wait until it does its job.

Dependency Problems Solved

As shown here, Maven resolved it so all the required dependencies are there.