Hi everybody,
here is a quick guide on how to build and run the "Hello, DAO!" sample
application from scratch. It will walk you through all the necessary
steps (including setting up all required development tools).
Here we go:
= 1 = Maven ==============================
A) download Maven and extract it to some folder, for example: C:\Dev
\apache-maven-2.1.0
http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.1.0-bin.zip
B) open MAVEN_HOME\conf\settings.xml and paste following code in
<mirrors> section:
<mirror>
<id>
ibiblio.org</id>
<url>
http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
C) add Maven binaries to your system path, in Windows: My Computer |
Properties | Advanced | Env. Variables --> System Variables section
Click New:
name = M2_HOME
value = C:\Dev\apache-maven-2.1.0 (or the folder you extracted Maven
to)
Click New:
name = MAVEN_OPTS
value = -Xms48m -Xmx512m
Click on "Path" variable and select Edit, add the following to its
value:
...;%M2_HOME%\bin;
D) select OK and verify that Maven is on your system path by executing
"cmd" and typing this:
mvn --version
This should print out something like this:
Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100)
... etc etc ...
= 2 = Ant ================================
A) download Ant and extract it to some folder, for example: C:\Dev
\apache-ant-1.7.1
http://apache.phphosts.org/ant/binaries/apache-ant-1.7.1-bin.zip
B) add Ant binaries to your system path, in Windows: My Computer |
Properties | Advanced | Env. Variables --> System Variables section
Click New:
name = ANT_HOME
value = C:\Dev\apache-ant-1.7.1 (or the folder you extracted Ant to)
Click on "Path" variable and select Edit, add the following to its
value:
...;%ANT_HOME%\bin;
C) select OK and verify that Ant is on your system path by executing
"cmd" and typing this:
ant -h
This should print out something like this:
ant [options] [target [target2 [target3] ...]]
... etc etc ...
= 3 = Eclipse + Google Plugin for Eclipse ==========
A) download Eclipse 3.4 (Ganymede) and extract it to some folder:
http://www.eclipse.org/downloads/
B) run Eclipse and set up your SVN provider and connector plugins by
using following update sites (Help | Software Updates | Available
Software | Add Site):
http://download.eclipse.org/technology/subversive/0.7/update-site/
(Subversive SVN team provider)
[ restart Eclipse ]
http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
(Subversive SVN connectors + SVNKit implementation)
C) install Google Plugin for Eclipse:
http://dl.google.com/eclipse/plugin/3.4
[ restart Eclipse ]
= 4 = Check out Hello, DAO from trunk ============
A) in Eclipse, switch to SVN perspective and right click in SVN
Repositories window: New | Repository Location
URL =
http://daofusion.googlecode.com/svn
B) browse to /trunk/samples and right click on hello-dao folder: Check
out
= 5 = Build and run Hello, DAO ==================
A) go to your workspace directory where you checked out Hello, DAO and
run this command:
mvn eclipse:eclipse
Maven will now download all dependencies and generate Eclipse project
files - this might take a minute or two.
B) after you see this:
BUILD SUCCESSFUL
go to Eclipse and refresh your project (right click and Refresh)
C) and finally, start the application by running this:
mvn clean jetty:run
Maven will do a clean project build (GWT compilation is done by
calling Ant from the build itself) - this can take a minute or two.
After you see this:
[INFO] Started Jetty Server
fire up your browser with following address:
http://localhost:8080/hellodao/init
This will initialize Hello, DAO test data and redirect you to the
actual application sitting on
http://localhost:8080/hellodao/.
Now you can explore the application sources in Eclipse. Note: you can
skip the "client" package if you're not familiar with Google Web
Toolkit (GWT).
Vojtech