GigaSpaces & Maven Setup : a mini-recipe

Posted 28 August 2008 @ 10:28 am by Owen Taylor

When trying out the bundled Maven tool that now ships with GigaSpaces, I found it friendly to my sensibilities to create a couple of new scripts:

I placed both of these in the GS_HOME/tools/maven directory:


mavensetup.cmd

set M2_HOME=%~dp0apache-maven-2.0.9
set PATH=%PATH%;%M2_HOME%\bin
call installmavenrep.bat


mavenshell.cmd

set M2_HOME=%~dp0apache-maven-2.0.9
set GS_HOME=%~dp0..\..
set PATH=%PATH%;%M2_HOME%\bin;%GS_HOME%\bin

start "MAVEN SHELL"

Once in my “MAVEN SHELL”, I can create a new application that uses the mirror service by executing:
C:\gigaspaces-xap-6.6.0-m3\tools\maven>mvn os:create dashDgroupId=com.test.mirror dash
DartifactId=MyFirstMirrorApp dashDtemplate=basic-async-persistency

With the project created – and quickly too! I now add another script to the mix:

In this example that would be the MyFirstMirrorApp directory found on my machine here:

C:\gigaspaces-xap-6.6.0-m3\tools\maven\MyFirstMirrorApp>

(Note: I execute this from within my “MAVEN SHELL” after CD‘ing into the MyFirstMirrorApp directory)


runmyproject.cmd

rem note you must setup mvn before trying to run this project in this way...

start mvn compile os:run dashDmodule=mirror


echo sleep
ping 1.1.1.1 -n 1 -w 60000 > NUL


start mvn compile os:run -Dcluster="total_members=2,1" -Dmodule=processor


echo sleep
ping 1.1.1.1 -n 1 -w 60000 > NUL


start mvn compile os:run -Dmodule=feeder

Once everything is running, I can start the GigaSpaces management User Interface by executing: the following from within my “MAVEN SHELL

>start gs-ui

Now comes the time for the final script of the day:


lookatmydb.cmd

mvn os:hsql-ui
dashDdriver=org.hsqldb.jdbcDriver
dashDurl=jdbc:hsqldb:hsql://localhost/testDB

executing the following query while in that viewer shows the data stored there :


select * from PUBLIC.DATA

Read more...

One Response to “GigaSpaces & Maven Setup : a mini-recipe”

  1. Roy Stokes Says:

    yb7zgoga57hnxezd

Leave a Reply